PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "constructors" (
"constructorId" INT,
"name" TEXT,
PRIMARY KEY ("constructorId")
);

CREATE TABLE "drivers" (
"driverId" INT UNIQUE,
"number" INT,
"code" TEXT,
"forename" TEXT,
"surname" TEXT,
"dob" DATE,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

CREATE TABLE "results" (
"resultId" INT,
"position" INT,
"points" FLOAT,
PRIMARY KEY ("resultId")
);



INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
INSERT INTO "constructors" VALUES ("4", "McLaren");
INSERT INTO "constructors" VALUES ("5", "Aston Martin");
INSERT INTO "drivers" VALUES ("1", "44", "HAM", "Lewis", "Hamilton", "1985-01-07", "British");
INSERT INTO "drivers" VALUES ("2", "33", "VER", "Max", "Verstappen", "1997-09-30", "Dutch");
INSERT INTO "drivers" VALUES ("3", "16", "LEC", "Charles", "Leclerc", "1997-10-16", "Monegasque");
INSERT INTO "drivers" VALUES ("4", "4", "NOR", "Lando", "Norris", "1999-11-13", "British");
INSERT INTO "drivers" VALUES ("5", "63", "RUS", "George", "Russell", "1998-02-15", "British");
INSERT INTO "drivers" VALUES ("6", "11", "PER", "Sergio", "Perez", "1990-01-26", "Mexican");
INSERT INTO "drivers" VALUES ("7", "55", "SAI", "Carlos", "Sainz", "1994-09-01", "Spanish");
INSERT INTO "drivers" VALUES ("8", "14", "ALO", "Fernando", "Alonso", "1981-07-29", "Spanish");
INSERT INTO "drivers" VALUES ("9", "81", "PIA", "Oscar", "Piastri", "2001-04-06", "Australian");
INSERT INTO "drivers" VALUES ("10", "23", "ALB", "Alexander", "Albon", "1996-03-23", "Thai");
INSERT INTO "drivers" VALUES ("11", "22", "TSU", "Yuki", "Tsunoda", "2000-05-11", "Japanese");
INSERT INTO "drivers" VALUES ("12", "24", "ZHO", "Guanyu", "Zhou", "1999-05-30", "Chinese");
INSERT INTO "drivers" VALUES ("13", "27", "HUL", "Nico", "Hulkenberg", "1987-08-19", "German");
INSERT INTO "drivers" VALUES ("14", "20", "MAG", "Kevin", "Magnussen", "1992-10-05", "Danish");
INSERT INTO "drivers" VALUES ("15", "18", "STR", "Lance", "Stroll", "1998-10-29", "Canadian");
INSERT INTO "drivers" VALUES ("16", "10", "GAS", "Pierre", "Gasly", "1996-02-07", "French");
INSERT INTO "drivers" VALUES ("17", "31", "OCO", "Esteban", "Ocon", "1996-09-17", "French");
INSERT INTO "drivers" VALUES ("18", "77", "BOT", "Valtteri", "Bottas", "1989-08-28", "Finnish");
INSERT INTO "drivers" VALUES ("19", "2", "SAR", "Logan", "Sargeant", "2000-12-31", "American");
INSERT INTO "drivers" VALUES ("20", "21", "DEV", "Nyck", "de Vries", "1995-02-06", "Dutch");
INSERT INTO "drivers" VALUES ("21", "40", "LAW", "Liam", "Lawson", "2002-02-11", "New Zealander");
INSERT INTO "results" VALUES ("1", "1", "25.0");
INSERT INTO "results" VALUES ("2", "2", "18.0");
INSERT INTO "results" VALUES ("3", "3", "15.0");
INSERT INTO "results" VALUES ("4", "4", "12.0");
INSERT INTO "results" VALUES ("5", "5", "10.0");
INSERT INTO "results" VALUES ("6", "6", "8.0");
INSERT INTO "results" VALUES ("7", "7", "6.0");
INSERT INTO "results" VALUES ("8", "8", "4.0");
INSERT INTO "results" VALUES ("9", "9", "2.0");
INSERT INTO "results" VALUES ("10", "10", "1.0");
INSERT INTO "results" VALUES ("11", "11", "0.0");
INSERT INTO "results" VALUES ("12", "12", "0.0");
INSERT INTO "results" VALUES ("13", "13", "0.0");
INSERT INTO "results" VALUES ("14", "14", "0.0");
INSERT INTO "results" VALUES ("15", "15", "0.0");
INSERT INTO "results" VALUES ("16", "16", "0.0");
INSERT INTO "results" VALUES ("17", "17", "0.0");
INSERT INTO "results" VALUES ("18", "18", "0.0");
INSERT INTO "results" VALUES ("19", "19", "0.0");
INSERT INTO "results" VALUES ("20", "20", "0.0");