-- Create the users table
CREATE TABLE users (id UUID PRIMARY KEY, name STRING, surname STRING);

-- Create the cars table with vid as an optional type
CREATE TABLE cars (id UUID PRIMARY KEY, vid Option(STRING), brand STRING, model STRING);

-- Insert entries into users
INSERT INTO users (id, name, surname) VALUES (u1001, "Jiří", "Novák");
INSERT INTO users (id, name, surname) VALUES (u1002, "Petr", "Svoboda");
INSERT INTO users (id, name, surname) VALUES (u1003, "Marek", "Dvořák");
INSERT INTO users (id, name, surname) VALUES (u1004, "Ondřej", "Černý");
INSERT INTO users (id, name, surname) VALUES (u1005, "Lukáš", "Krátký");
INSERT INTO users (id, name, surname) VALUES (u1006, "さくら", "たなか");
INSERT INTO users (id, name, surname) VALUES (u1007, "ひろし", "すずき");
INSERT INTO users (id, name, surname) VALUES (u1008, "れいこ", "こばやし");
INSERT INTO users (id, name, surname) VALUES (u1009, "ゆうた", "わたなべ");
INSERT INTO users (id, name, surname) VALUES (u1010, "あやか", "おかもと");

-- Insert entries into cars
INSERT INTO cars (id, vid, brand, model) VALUES (u2001, None, "Toyota", "Corolla");
INSERT INTO cars (id, vid, brand, model) VALUES (u2002, None, "Ford", "Fiesta");
INSERT INTO cars (id, vid, brand, model) VALUES (u2003, Some("WBAKB0C52AC111480"), "Volkswagen", "Golf");
INSERT INTO cars (id, vid, brand, model) VALUES (u2004, Some("3D73Y4CL4BG009999"), "Honda", "Civic");
INSERT INTO cars (id, vid, brand, model) VALUES (u2005, None, "Hyundai", "Elantra");
INSERT INTO cars (id, vid, brand, model) VALUES (u2006, Some("JN8AS5MTXBW273113"), "Ford", "Focus");
INSERT INTO cars (id, vid, brand, model) VALUES (u2007, None, "Nissan", "Sentra");
INSERT INTO cars (id, vid, brand, model) VALUES (u2008, Some("SCFFDABE1BG998717"), "Chevrolet", "Malibu");
INSERT INTO cars (id, vid, brand, model) VALUES (u2009, None, "Kia", "Optima");
INSERT INTO cars (id, vid, brand, model) VALUES (u2010, Some("1G4GG5E35DF715445"), "Audi", "A4");

-- SELECT and DELETE commands for users and cars
SELECT * FROM users;
SELECT name FROM users;
SELECT name, surname FROM users;
SELECT * FROM users WHERE name = "さくら";
DELETE FROM users WHERE surname = "Novák";
SELECT * FROM users;

SELECT * FROM cars;
SELECT brand FROM cars;
SELECT brand, model FROM cars;
SELECT * FROM cars WHERE brand = "Ford";
DELETE FROM cars WHERE brand = "Ford";
SELECT * FROM cars;
