From ed6bbef9d6b348c76a2355cdd375431a3a994f00 Mon Sep 17 00:00:00 2001 From: soypete Date: Wed, 4 Oct 2023 19:58:41 -0600 Subject: [PATCH] code-slides: add slide with sql examples. this one in particular highlights an update that is not in the go code. Signed-off-by: soypete --- code-slides/day-2-databases/update.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 code-slides/day-2-databases/update.sql diff --git a/code-slides/day-2-databases/update.sql b/code-slides/day-2-databases/update.sql new file mode 100644 index 0000000..cec5793 --- /dev/null +++ b/code-slides/day-2-databases/update.sql @@ -0,0 +1,14 @@ +CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY, + name TEXT, + email TEXT UNIQUE, + password TEXT NOT NULL); + +INSERT INTO users (name, email, password) VALUES + ('John Doe', ' john.doe@email.com', 'opensesame') +INSERT INTO users (name, email, password) VALUES +('Jane Smith', 'smithjane@email.com', 'opensesame') + +UPDATE users SET name = 'Alfred Doe' WHERE id = 1; + +SELECT * FROM users;