From 51bd9955e2965e933d03c71a3978d2fb7f5386b1 Mon Sep 17 00:00:00 2001 From: Ronaldo Ferreira de Lima Date: Tue, 5 Aug 2025 19:01:20 -0300 Subject: [PATCH 1/5] * add practice exercise: space-age --- config.json | 8 ++++ .../space-age/.docs/instructions.append.md | 32 ++++++++++++++ .../practice/space-age/.docs/instructions.md | 28 ++++++++++++ .../practice/space-age/.docs/introduction.md | 20 +++++++++ .../practice/space-age/.meta/config.json | 19 ++++++++ .../practice/space-age/.meta/example.sql | 29 +++++++++++++ exercises/practice/space-age/.meta/tests.toml | 37 ++++++++++++++++ .../practice/space-age/create_fixture.sql | 11 +++++ .../practice/space-age/create_test_table.sql | 28 ++++++++++++ exercises/practice/space-age/data.csv | 9 ++++ exercises/practice/space-age/space-age.sql | 10 +++++ .../practice/space-age/space-age_test.sql | 43 +++++++++++++++++++ 12 files changed, 274 insertions(+) create mode 100644 exercises/practice/space-age/.docs/instructions.append.md create mode 100644 exercises/practice/space-age/.docs/instructions.md create mode 100644 exercises/practice/space-age/.docs/introduction.md create mode 100644 exercises/practice/space-age/.meta/config.json create mode 100644 exercises/practice/space-age/.meta/example.sql create mode 100644 exercises/practice/space-age/.meta/tests.toml create mode 100644 exercises/practice/space-age/create_fixture.sql create mode 100644 exercises/practice/space-age/create_test_table.sql create mode 100644 exercises/practice/space-age/data.csv create mode 100644 exercises/practice/space-age/space-age.sql create mode 100644 exercises/practice/space-age/space-age_test.sql diff --git a/config.json b/config.json index 4f3db86..61ab73e 100644 --- a/config.json +++ b/config.json @@ -122,6 +122,14 @@ "prerequisites": [], "difficulty": 2 }, + { + "slug": "space-age", + "name": "Space Age", + "uuid": "09b96007-c782-4b5e-b929-48bab73b5f69", + "practices": [], + "prerequisites": [], + "difficulty": 2 + }, { "slug": "allergies", "name": "Allergies", diff --git a/exercises/practice/space-age/.docs/instructions.append.md b/exercises/practice/space-age/.docs/instructions.append.md new file mode 100644 index 0000000..644f436 --- /dev/null +++ b/exercises/practice/space-age/.docs/instructions.append.md @@ -0,0 +1,32 @@ +# SQLite-specific instructions + +* The **result** column should contain JSON-encoded data: an object + with the age as double or a description of any errors. + +Examples: +``` +sqlite> SELECT JSON_OBJECT('age', 31.69); +{"age":31.69} +``` +or +``` +sqlite> SELECT JSON_OBJECT('error', 'some error description'); +{"error":"some error description"} +``` + +## Table Schema + +```sql +CREATE TABLE "space-age" ( + planet TEXT NOT NULL, + seconds INTEGER NOT NULL, + result TEXT -- json object +); + +``` + +## JSON documentation + +[JSON Functions And Operators][json-docs] + +[json-docs]: https://www.sqlite.org/json1.html diff --git a/exercises/practice/space-age/.docs/instructions.md b/exercises/practice/space-age/.docs/instructions.md new file mode 100644 index 0000000..f23b5e2 --- /dev/null +++ b/exercises/practice/space-age/.docs/instructions.md @@ -0,0 +1,28 @@ +# Instructions + +Given an age in seconds, calculate how old someone would be on a planet in our Solar System. + +One Earth year equals 365.25 Earth days, or 31,557,600 seconds. +If you were told someone was 1,000,000,000 seconds old, their age would be 31.69 Earth-years. + +For the other planets, you have to account for their orbital period in Earth Years: + +| Planet | Orbital period in Earth Years | +| ------- | ----------------------------- | +| Mercury | 0.2408467 | +| Venus | 0.61519726 | +| Earth | 1.0 | +| Mars | 1.8808158 | +| Jupiter | 11.862615 | +| Saturn | 29.447498 | +| Uranus | 84.016846 | +| Neptune | 164.79132 | + +~~~~exercism/note +The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year). +The Gregorian calendar has, on average, 365.2425 days. +While not entirely accurate, 365.25 is the value used in this exercise. +See [Year on Wikipedia][year] for more ways to measure a year. + +[year]: https://en.wikipedia.org/wiki/Year#Summary +~~~~ diff --git a/exercises/practice/space-age/.docs/introduction.md b/exercises/practice/space-age/.docs/introduction.md new file mode 100644 index 0000000..014d788 --- /dev/null +++ b/exercises/practice/space-age/.docs/introduction.md @@ -0,0 +1,20 @@ +# Introduction + +The year is 2525 and you've just embarked on a journey to visit all planets in the Solar System (Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune). +The first stop is Mercury, where customs require you to fill out a form (bureaucracy is apparently _not_ Earth-specific). +As you hand over the form to the customs officer, they scrutinize it and frown. +"Do you _really_ expect me to believe you're just 50 years old? +You must be closer to 200 years old!" + +Amused, you wait for the customs officer to start laughing, but they appear to be dead serious. +You realize that you've entered your age in _Earth years_, but the officer expected it in _Mercury years_! +As Mercury's orbital period around the sun is significantly shorter than Earth, you're actually a lot older in Mercury years. +After some quick calculations, you're able to provide your age in Mercury Years. +The customs officer smiles, satisfied, and waves you through. +You make a mental note to pre-calculate your planet-specific age _before_ future customs checks, to avoid such mix-ups. + +~~~~exercism/note +If you're wondering why Pluto didn't make the cut, go watch [this YouTube video][pluto-video]. + +[pluto-video]: https://www.youtube.com/watch?v=Z_2gbGXzFbs +~~~~ diff --git a/exercises/practice/space-age/.meta/config.json b/exercises/practice/space-age/.meta/config.json new file mode 100644 index 0000000..5a04654 --- /dev/null +++ b/exercises/practice/space-age/.meta/config.json @@ -0,0 +1,19 @@ +{ + "authors": [ + "jimmytty" + ], + "files": { + "solution": [ + "space-age.sql" + ], + "test": [ + "space-age_test.sql" + ], + "example": [ + ".meta/example.sql" + ] + }, + "blurb": "Given an age in seconds, calculate how old someone is in terms of a given planet's solar years.", + "source": "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial.", + "source_url": "https://pine.fm/LearnToProgram/?Chapter=01" +} diff --git a/exercises/practice/space-age/.meta/example.sql b/exercises/practice/space-age/.meta/example.sql new file mode 100644 index 0000000..dc3f16f --- /dev/null +++ b/exercises/practice/space-age/.meta/example.sql @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS tmp; +CREATE TEMPORARY TABLE tmp ( + p TEXT UNIQUE NOT NULL, + op REAL NOT NULL +); +INSERT INTO tmp (p, op) +VALUES ('Mercury', 0.2408467 ), + ('Venus' , 0.61519726), + ('Earth' , 1.0 ), + ('Mars' , 1.8808158 ), + ('Jupiter', 11.862615 ), + ('Saturn' , 29.447498 ), + ('Uranus' , 84.016846 ), + ('Neptune', 164.79132 ); + +UPDATE "space-age" + SET result = JSON_OBJECT('error', 'not a planet') + WHERE NOT EXISTS (SELECT 1 FROM tmp WHERE p = planet) +; + +UPDATE "space-age" + SET result = JSON_OBJECT( + 'age', + ROUND("space-age".seconds / 31557600.0 / tmp.op, 2) + ) + FROM tmp + WHERE "space-age".planet = tmp.p + AND "space-age".result ISNULL +; diff --git a/exercises/practice/space-age/.meta/tests.toml b/exercises/practice/space-age/.meta/tests.toml new file mode 100644 index 0000000..7957bb7 --- /dev/null +++ b/exercises/practice/space-age/.meta/tests.toml @@ -0,0 +1,37 @@ +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. + +[84f609af-5a91-4d68-90a3-9e32d8a5cd34] +description = "age on Earth" + +[ca20c4e9-6054-458c-9312-79679ffab40b] +description = "age on Mercury" + +[502c6529-fd1b-41d3-8fab-65e03082b024] +description = "age on Venus" + +[9ceadf5e-a0d5-4388-9d40-2c459227ceb8] +description = "age on Mars" + +[42927dc3-fe5e-4f76-a5b5-f737fc19bcde] +description = "age on Jupiter" + +[8469b332-7837-4ada-b27c-00ee043ebcad] +description = "age on Saturn" + +[999354c1-76f8-4bb5-a672-f317b6436743] +description = "age on Uranus" + +[80096d30-a0d4-4449-903e-a381178355d8] +description = "age on Neptune" + +[57b96e2a-1178-40b7-b34d-f3c9c34e4bf4] +description = "invalid planet causes error" diff --git a/exercises/practice/space-age/create_fixture.sql b/exercises/practice/space-age/create_fixture.sql new file mode 100644 index 0000000..c37fd3f --- /dev/null +++ b/exercises/practice/space-age/create_fixture.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS "space-age"; +CREATE TABLE "space-age" ( + planet TEXT NOT NULL, + seconds INTEGER NOT NULL, + result TEXT -- json object +); + +.mode csv +.import ./data.csv "space-age" + +UPDATE "space-age" SET result = NULL; diff --git a/exercises/practice/space-age/create_test_table.sql b/exercises/practice/space-age/create_test_table.sql new file mode 100644 index 0000000..bafe693 --- /dev/null +++ b/exercises/practice/space-age/create_test_table.sql @@ -0,0 +1,28 @@ +DROP TABLE IF EXISTS tests; +CREATE TABLE IF NOT EXISTS tests ( + -- uuid and description are taken from the test.toml file + uuid TEXT PRIMARY KEY, + description TEXT NOT NULL, + -- The following section is needed by the online test-runner + status TEXT DEFAULT 'fail', + message TEXT, + output TEXT, + test_code TEXT, + task_id INTEGER DEFAULT NULL, + -- Here are columns for the actual tests + planet TEXT NOT NULL, + seconds INTEGER NOT NULL, + expected TEXT NOT NULL -- json object +); + +INSERT INTO tests (uuid, description, planet, seconds, expected) + VALUES + ('84f609af-5a91-4d68-90a3-9e32d8a5cd34','age on Earth','Earth',1000000000,'{"age":31.69}'), + ('ca20c4e9-6054-458c-9312-79679ffab40b','age on Mercury','Mercury',2134835688,'{"age":280.88}'), + ('502c6529-fd1b-41d3-8fab-65e03082b024','age on Venus','Venus',189839836,'{"age":9.78}'), + ('9ceadf5e-a0d5-4388-9d40-2c459227ceb8','age on Mars','Mars',2129871239,'{"age":35.88}'), + ('42927dc3-fe5e-4f76-a5b5-f737fc19bcde','age on Jupiter','Jupiter',901876382,'{"age":2.41}'), + ('8469b332-7837-4ada-b27c-00ee043ebcad','age on Saturn','Saturn',2000000000,'{"age":2.15}'), + ('999354c1-76f8-4bb5-a672-f317b6436743','age on Uranus','Uranus',1210123456,'{"age":0.46}'), + ('80096d30-a0d4-4449-903e-a381178355d8','age on Neptune','Neptune',1821023456,'{"age":0.35}'), + ('57b96e2a-1178-40b7-b34d-f3c9c34e4bf4','invalid planet causes error','Sun',680804807,'{"error":"not a planet"}'); diff --git a/exercises/practice/space-age/data.csv b/exercises/practice/space-age/data.csv new file mode 100644 index 0000000..94640b9 --- /dev/null +++ b/exercises/practice/space-age/data.csv @@ -0,0 +1,9 @@ +"Earth",1000000000,"" +"Mercury",2134835688,"" +"Venus",189839836,"" +"Mars",2129871239,"" +"Jupiter",901876382,"" +"Saturn",2000000000,"" +"Uranus",1210123456,"" +"Neptune",1821023456,"" +"Sun",680804807,"" diff --git a/exercises/practice/space-age/space-age.sql b/exercises/practice/space-age/space-age.sql new file mode 100644 index 0000000..f41ac28 --- /dev/null +++ b/exercises/practice/space-age/space-age.sql @@ -0,0 +1,10 @@ +-- Schema: CREATE TABLE "space-age" ( +-- planet TEXT NOT NULL, +-- seconds INTEGER NOT NULL, +-- result TEXT -- json object +-- ); +-- Task: update the space-age table and set the result based on planet +-- and seconds. +-- * the result column should contain JSON-encoded data: an +-- object with the age as double or a description of any +-- errors. diff --git a/exercises/practice/space-age/space-age_test.sql b/exercises/practice/space-age/space-age_test.sql new file mode 100644 index 0000000..946be88 --- /dev/null +++ b/exercises/practice/space-age/space-age_test.sql @@ -0,0 +1,43 @@ +-- Create database: +.read ./create_fixture.sql + +-- Read user student solution and save any output as markdown in user_output.md: +.mode markdown +.output user_output.md +.read ./space-age.sql +.output + +-- Create a clean testing environment: +.read ./create_test_table.sql + +-- Comparison of user input and the tests updates the status for each test: +UPDATE tests +SET status = 'pass' +FROM (SELECT planet, seconds, result FROM "space-age") AS actual +WHERE (actual.planet, actual.seconds, JSON(actual.result)) = (tests.planet, tests.seconds, JSON(tests.expected)); + +-- Update message for failed tests to give helpful information: +UPDATE tests +SET message = ( + 'Result for "' + || JSON_OBJECT( + 'planet', tests.planet, + 'seconds', tests.seconds + ) + || '"' + || ' is <' || COALESCE(actual.result, 'NULL') + || '> but should be <' || tests.expected || '>' +) +FROM (SELECT planet, seconds, result FROM "space-age") AS actual +WHERE (actual.planet, actual.seconds) = (tests.planet, tests.seconds) AND tests.status = 'fail'; + +-- Save results to ./output.json (needed by the online test-runner) +.mode json +.once './output.json' +SELECT description, status, message, output, test_code, task_id +FROM tests; + +-- Display test results in readable form for the student: +.mode table +SELECT description, status, message +FROM tests; From 9012c01407f428f168c17cbbb399df7732ce391e Mon Sep 17 00:00:00 2001 From: Ronaldo Ferreira de Lima Date: Tue, 5 Aug 2025 20:32:47 -0300 Subject: [PATCH 2/5] Update exercises/practice/space-age/.docs/instructions.append.md Co-authored-by: Isaac Good --- exercises/practice/space-age/.docs/instructions.append.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/practice/space-age/.docs/instructions.append.md b/exercises/practice/space-age/.docs/instructions.append.md index 644f436..0ade28b 100644 --- a/exercises/practice/space-age/.docs/instructions.append.md +++ b/exercises/practice/space-age/.docs/instructions.append.md @@ -1,7 +1,6 @@ # SQLite-specific instructions -* The **result** column should contain JSON-encoded data: an object - with the age as double or a description of any errors. +* The **result** column should contain JSON-encoded data: an object with the age as double or a description of any errors. Examples: ``` From f4acffd4fe69260cf094e09f8ddc18d03ff45964 Mon Sep 17 00:00:00 2001 From: Ronaldo Ferreira de Lima Date: Tue, 5 Aug 2025 20:39:49 -0300 Subject: [PATCH 3/5] * more descriptive names + indentation --- .../practice/space-age/.meta/example.sql | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/exercises/practice/space-age/.meta/example.sql b/exercises/practice/space-age/.meta/example.sql index dc3f16f..5481ede 100644 --- a/exercises/practice/space-age/.meta/example.sql +++ b/exercises/practice/space-age/.meta/example.sql @@ -1,9 +1,9 @@ -DROP TABLE IF EXISTS tmp; -CREATE TEMPORARY TABLE tmp ( - p TEXT UNIQUE NOT NULL, - op REAL NOT NULL +DROP TABLE IF EXISTS planets; +CREATE TEMPORARY TABLE planets ( + name TEXT UNIQUE NOT NULL, + period REAL NOT NULL ); -INSERT INTO tmp (p, op) +INSERT INTO planets (name, period) VALUES ('Mercury', 0.2408467 ), ('Venus' , 0.61519726), ('Earth' , 1.0 ), @@ -15,15 +15,15 @@ VALUES ('Mercury', 0.2408467 ), UPDATE "space-age" SET result = JSON_OBJECT('error', 'not a planet') - WHERE NOT EXISTS (SELECT 1 FROM tmp WHERE p = planet) -; + WHERE NOT EXISTS (SELECT 1 FROM planets WHERE name = planet) + ; UPDATE "space-age" SET result = JSON_OBJECT( - 'age', - ROUND("space-age".seconds / 31557600.0 / tmp.op, 2) - ) - FROM tmp - WHERE "space-age".planet = tmp.p + 'age', + ROUND("space-age".seconds / 31557600.0 / planets.period, 2) + ) + FROM planets + WHERE "space-age".planet = planets.name AND "space-age".result ISNULL -; + ; From dbcdfa2154113ca3ce3a10ba67fb97f573cf93d1 Mon Sep 17 00:00:00 2001 From: Ronaldo Ferreira de Lima Date: Wed, 6 Aug 2025 09:39:51 -0300 Subject: [PATCH 4/5] * removing json dependency for result column --- .../space-age/.docs/instructions.append.md | 31 ------------------- .../practice/space-age/.meta/example.sql | 10 +----- exercises/practice/space-age/.meta/tests.toml | 1 + .../practice/space-age/create_fixture.sql | 2 +- .../practice/space-age/create_test_table.sql | 20 ++++++------ exercises/practice/space-age/data.csv | 1 - exercises/practice/space-age/space-age.sql | 5 +-- 7 files changed, 14 insertions(+), 56 deletions(-) delete mode 100644 exercises/practice/space-age/.docs/instructions.append.md diff --git a/exercises/practice/space-age/.docs/instructions.append.md b/exercises/practice/space-age/.docs/instructions.append.md deleted file mode 100644 index 0ade28b..0000000 --- a/exercises/practice/space-age/.docs/instructions.append.md +++ /dev/null @@ -1,31 +0,0 @@ -# SQLite-specific instructions - -* The **result** column should contain JSON-encoded data: an object with the age as double or a description of any errors. - -Examples: -``` -sqlite> SELECT JSON_OBJECT('age', 31.69); -{"age":31.69} -``` -or -``` -sqlite> SELECT JSON_OBJECT('error', 'some error description'); -{"error":"some error description"} -``` - -## Table Schema - -```sql -CREATE TABLE "space-age" ( - planet TEXT NOT NULL, - seconds INTEGER NOT NULL, - result TEXT -- json object -); - -``` - -## JSON documentation - -[JSON Functions And Operators][json-docs] - -[json-docs]: https://www.sqlite.org/json1.html diff --git a/exercises/practice/space-age/.meta/example.sql b/exercises/practice/space-age/.meta/example.sql index 5481ede..753e327 100644 --- a/exercises/practice/space-age/.meta/example.sql +++ b/exercises/practice/space-age/.meta/example.sql @@ -14,15 +14,7 @@ VALUES ('Mercury', 0.2408467 ), ('Neptune', 164.79132 ); UPDATE "space-age" - SET result = JSON_OBJECT('error', 'not a planet') - WHERE NOT EXISTS (SELECT 1 FROM planets WHERE name = planet) - ; - -UPDATE "space-age" - SET result = JSON_OBJECT( - 'age', - ROUND("space-age".seconds / 31557600.0 / planets.period, 2) - ) + SET result = ROUND("space-age".seconds / 31557600.0 / planets.period, 2) FROM planets WHERE "space-age".planet = planets.name AND "space-age".result ISNULL diff --git a/exercises/practice/space-age/.meta/tests.toml b/exercises/practice/space-age/.meta/tests.toml index 7957bb7..0757879 100644 --- a/exercises/practice/space-age/.meta/tests.toml +++ b/exercises/practice/space-age/.meta/tests.toml @@ -35,3 +35,4 @@ description = "age on Neptune" [57b96e2a-1178-40b7-b34d-f3c9c34e4bf4] description = "invalid planet causes error" +include = false \ No newline at end of file diff --git a/exercises/practice/space-age/create_fixture.sql b/exercises/practice/space-age/create_fixture.sql index c37fd3f..1fb467f 100644 --- a/exercises/practice/space-age/create_fixture.sql +++ b/exercises/practice/space-age/create_fixture.sql @@ -2,7 +2,7 @@ DROP TABLE IF EXISTS "space-age"; CREATE TABLE "space-age" ( planet TEXT NOT NULL, seconds INTEGER NOT NULL, - result TEXT -- json object + result REAL ); .mode csv diff --git a/exercises/practice/space-age/create_test_table.sql b/exercises/practice/space-age/create_test_table.sql index bafe693..8be0074 100644 --- a/exercises/practice/space-age/create_test_table.sql +++ b/exercises/practice/space-age/create_test_table.sql @@ -12,17 +12,17 @@ CREATE TABLE IF NOT EXISTS tests ( -- Here are columns for the actual tests planet TEXT NOT NULL, seconds INTEGER NOT NULL, - expected TEXT NOT NULL -- json object + expected REAL ); INSERT INTO tests (uuid, description, planet, seconds, expected) VALUES - ('84f609af-5a91-4d68-90a3-9e32d8a5cd34','age on Earth','Earth',1000000000,'{"age":31.69}'), - ('ca20c4e9-6054-458c-9312-79679ffab40b','age on Mercury','Mercury',2134835688,'{"age":280.88}'), - ('502c6529-fd1b-41d3-8fab-65e03082b024','age on Venus','Venus',189839836,'{"age":9.78}'), - ('9ceadf5e-a0d5-4388-9d40-2c459227ceb8','age on Mars','Mars',2129871239,'{"age":35.88}'), - ('42927dc3-fe5e-4f76-a5b5-f737fc19bcde','age on Jupiter','Jupiter',901876382,'{"age":2.41}'), - ('8469b332-7837-4ada-b27c-00ee043ebcad','age on Saturn','Saturn',2000000000,'{"age":2.15}'), - ('999354c1-76f8-4bb5-a672-f317b6436743','age on Uranus','Uranus',1210123456,'{"age":0.46}'), - ('80096d30-a0d4-4449-903e-a381178355d8','age on Neptune','Neptune',1821023456,'{"age":0.35}'), - ('57b96e2a-1178-40b7-b34d-f3c9c34e4bf4','invalid planet causes error','Sun',680804807,'{"error":"not a planet"}'); + ('84f609af-5a91-4d68-90a3-9e32d8a5cd34','age on Earth','Earth',1000000000,31.69), + ('ca20c4e9-6054-458c-9312-79679ffab40b','age on Mercury','Mercury',2134835688,280.88), + ('502c6529-fd1b-41d3-8fab-65e03082b024','age on Venus','Venus',189839836,9.78), + ('9ceadf5e-a0d5-4388-9d40-2c459227ceb8','age on Mars','Mars',2129871239,35.88), + ('42927dc3-fe5e-4f76-a5b5-f737fc19bcde','age on Jupiter','Jupiter',901876382,2.41), + ('8469b332-7837-4ada-b27c-00ee043ebcad','age on Saturn','Saturn',2000000000,2.15), + ('999354c1-76f8-4bb5-a672-f317b6436743','age on Uranus','Uranus',1210123456,0.46), + ('80096d30-a0d4-4449-903e-a381178355d8','age on Neptune','Neptune',1821023456,0.35); + diff --git a/exercises/practice/space-age/data.csv b/exercises/practice/space-age/data.csv index 94640b9..ce1ae2d 100644 --- a/exercises/practice/space-age/data.csv +++ b/exercises/practice/space-age/data.csv @@ -6,4 +6,3 @@ "Saturn",2000000000,"" "Uranus",1210123456,"" "Neptune",1821023456,"" -"Sun",680804807,"" diff --git a/exercises/practice/space-age/space-age.sql b/exercises/practice/space-age/space-age.sql index f41ac28..eb00d79 100644 --- a/exercises/practice/space-age/space-age.sql +++ b/exercises/practice/space-age/space-age.sql @@ -1,10 +1,7 @@ -- Schema: CREATE TABLE "space-age" ( -- planet TEXT NOT NULL, -- seconds INTEGER NOT NULL, --- result TEXT -- json object +-- result REAL -- ); -- Task: update the space-age table and set the result based on planet -- and seconds. --- * the result column should contain JSON-encoded data: an --- object with the age as double or a description of any --- errors. From ef98f21cf660b34af7e0a961a52539e54704f66e Mon Sep 17 00:00:00 2001 From: Ronaldo Ferreira de Lima Date: Wed, 6 Aug 2025 16:05:14 -0300 Subject: [PATCH 5/5] Update exercises/practice/space-age/.meta/tests.toml Co-authored-by: Isaac Good --- exercises/practice/space-age/.meta/tests.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/practice/space-age/.meta/tests.toml b/exercises/practice/space-age/.meta/tests.toml index 0757879..cec74fb 100644 --- a/exercises/practice/space-age/.meta/tests.toml +++ b/exercises/practice/space-age/.meta/tests.toml @@ -35,4 +35,5 @@ description = "age on Neptune" [57b96e2a-1178-40b7-b34d-f3c9c34e4bf4] description = "invalid planet causes error" -include = false \ No newline at end of file +include = false +comment = "error testing omitted on purpose" \ No newline at end of file