From 55f92e5c258eac99b1d6bd0c02447401fa584c61 Mon Sep 17 00:00:00 2001 From: Todd Schwartz Date: Wed, 22 Oct 2025 07:11:35 -0700 Subject: [PATCH 1/2] Update hello-world to work as a query --- exercises/practice/hello-world/create_fixture.sql | 3 --- exercises/practice/hello-world/hello-world.sql | 5 +---- exercises/practice/hello-world/hello-world_test.sql | 9 +++++++++ exercises/practice/hello-world/test_setup.sql | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/exercises/practice/hello-world/create_fixture.sql b/exercises/practice/hello-world/create_fixture.sql index a936bcf0..e69de29b 100644 --- a/exercises/practice/hello-world/create_fixture.sql +++ b/exercises/practice/hello-world/create_fixture.sql @@ -1,3 +0,0 @@ -DROP TABLE IF EXISTS hello_world; - -CREATE TABLE hello_world (greeting TEXT); diff --git a/exercises/practice/hello-world/hello-world.sql b/exercises/practice/hello-world/hello-world.sql index 610302fc..4ea08df0 100644 --- a/exercises/practice/hello-world/hello-world.sql +++ b/exercises/practice/hello-world/hello-world.sql @@ -1,4 +1 @@ -INSERT INTO - hello_world (greeting) -VALUES - ('Goodbye, Mars!'); +SELECT "Goodbye, Mars!"; diff --git a/exercises/practice/hello-world/hello-world_test.sql b/exercises/practice/hello-world/hello-world_test.sql index 23d06815..b44c1335 100644 --- a/exercises/practice/hello-world/hello-world_test.sql +++ b/exercises/practice/hello-world/hello-world_test.sql @@ -10,6 +10,15 @@ VALUES 'Hello, World!' ); +.mode csv +.output user_output.csv +.read hello-world.sql +.output + +DROP TABLE IF EXISTS hello_world; +CREATE TABLE hello_world (greeting TEXT); +.import user_output.csv hello_world + -- Comparison of user input and the tests updates the status for each test: UPDATE tests SET diff --git a/exercises/practice/hello-world/test_setup.sql b/exercises/practice/hello-world/test_setup.sql index 726b404d..921fab7e 100644 --- a/exercises/practice/hello-world/test_setup.sql +++ b/exercises/practice/hello-world/test_setup.sql @@ -1,7 +1,7 @@ -- Create database: .read ./create_fixture.sql -- Read user student solution and save any output as markdown in user_output.md: -.mode markdown +.mode list .output user_output.md .read ./hello-world.sql .output From 760446413abfb067fd4927d69e6ef70e51258ac7 Mon Sep 17 00:00:00 2001 From: Todd Schwartz Date: Wed, 22 Oct 2025 09:05:38 -0700 Subject: [PATCH 2/2] Update example.sql --- exercises/practice/hello-world/.meta/example.sql | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/exercises/practice/hello-world/.meta/example.sql b/exercises/practice/hello-world/.meta/example.sql index 505c8e81..d77af4e9 100644 --- a/exercises/practice/hello-world/.meta/example.sql +++ b/exercises/practice/hello-world/.meta/example.sql @@ -1,4 +1 @@ -INSERT INTO - hello_world (greeting) -VALUES - ('Hello, World!'); +SELECT "Hello, World!";