Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions exercises/practice/hello-world/.meta/example.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
INSERT INTO
hello_world (greeting)
VALUES
('Hello, World!');
SELECT "Hello, World!";
3 changes: 0 additions & 3 deletions exercises/practice/hello-world/create_fixture.sql
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
DROP TABLE IF EXISTS hello_world;

CREATE TABLE hello_world (greeting TEXT);
5 changes: 1 addition & 4 deletions exercises/practice/hello-world/hello-world.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
INSERT INTO
hello_world (greeting)
VALUES
('Goodbye, Mars!');
SELECT "Goodbye, Mars!";
9 changes: 9 additions & 0 deletions exercises/practice/hello-world/hello-world_test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/hello-world/test_setup.sql
Original file line number Diff line number Diff line change
@@ -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
Expand Down