From 6ce7cd2dcfc0eac4bb0ada85befe0a742b580b5f Mon Sep 17 00:00:00 2001 From: karlderkaefer Date: Sun, 19 Nov 2023 19:45:13 +0100 Subject: [PATCH] add sql workshop --- sql-basics/intro.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sql-basics/intro.md b/sql-basics/intro.md index 13b50e2..021237a 100644 --- a/sql-basics/intro.md +++ b/sql-basics/intro.md @@ -15,6 +15,14 @@ SQL (Structured Query Language) is a standard language for accessing and manipul Let's get started with setting up your SQL environment and exploring some basic concepts! +## Create Database + +First we need to create the database for the scenario. Execute the following command to create the database: + +```bash +sqlite3 workshop.db "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER);" +sqlite3 workshop.db "INSERT INTO users (name, age) VALUES ('Alice', 30), ('Bob', 25), ('Charlie', 35);" +```{{exec}} ## Viewing Table Structure