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 "drivers" (
"driverId" INT,
"forename" TEXT,
"surname" TEXT,
PRIMARY KEY ("driverId")
);

CREATE TABLE "races" (
"raceId" INT UNIQUE,
"year" INT,
"round" INT,
"name" TEXT,
PRIMARY KEY ("raceId")
);

CREATE TABLE "results" (
"resultId" INT,
"raceId" INT,
"time" TEXT,
PRIMARY KEY ("resultId"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId")
);



INSERT INTO "drivers" VALUES ("1", "Lewis", "Hamilton");
INSERT INTO "drivers" VALUES ("2", "Max", "Verstappen");
INSERT INTO "drivers" VALUES ("3", "Charles", "Leclerc");
INSERT INTO "drivers" VALUES ("4", "Sergio", "Perez");
INSERT INTO "drivers" VALUES ("5", "George", "Russell");
INSERT INTO "drivers" VALUES ("6", "Carlos", "Sainz");
INSERT INTO "drivers" VALUES ("7", "Lando", "Norris");
INSERT INTO "drivers" VALUES ("8", "Fernando", "Alonso");
INSERT INTO "drivers" VALUES ("9", "Valtteri", "Bottas");
INSERT INTO "drivers" VALUES ("10", "Daniel", "Ricciardo");
INSERT INTO "races" VALUES ("1", "2023", "1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("2", "2023", "2", "Saudi Arabian Grand Prix");
INSERT INTO "races" VALUES ("3", "2023", "3", "Australian Grand Prix");
INSERT INTO "races" VALUES ("4", "2022", "1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("5", "2022", "2", "Saudi Arabian Grand Prix");
INSERT INTO "races" VALUES ("6", "2022", "3", "Australian Grand Prix");
INSERT INTO "races" VALUES ("7", "2021", "1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("8", "2021", "2", "Emilia Romagna Grand Prix");
INSERT INTO "results" VALUES ("1", "1", "1:33:27.456");
INSERT INTO "results" VALUES ("2", "1", "1:33:28.123");
INSERT INTO "results" VALUES ("3", "1", "1:33:29.500");
INSERT INTO "results" VALUES ("4", "1", "1:33:30.000");
INSERT INTO "results" VALUES ("5", "1", "1:33:31.200");
INSERT INTO "results" VALUES ("6", "1", "1:33:32.100");
INSERT INTO "results" VALUES ("7", "1", "1:33:33.500");
INSERT INTO "results" VALUES ("8", "1", "1:33:34.000");
INSERT INTO "results" VALUES ("9", "1", "1:33:35.100");
INSERT INTO "results" VALUES ("10", "1", "1:33:36.000");
INSERT INTO "results" VALUES ("11", "1", "NULL");
INSERT INTO "results" VALUES ("12", "1", "NULL");
INSERT INTO "results" VALUES ("13", "2", "1:30:15.123");
INSERT INTO "results" VALUES ("14", "2", "1:30:16.456");
INSERT INTO "results" VALUES ("15", "2", "1:30:17.000");
INSERT INTO "results" VALUES ("16", "2", "1:30:18.500");
INSERT INTO "results" VALUES ("17", "2", "1:30:19.200");
INSERT INTO "results" VALUES ("18", "2", "1:30:20.100");
INSERT INTO "results" VALUES ("19", "2", "1:30:21.500");
INSERT INTO "results" VALUES ("20", "2", "1:30:22.000");
INSERT INTO "results" VALUES ("21", "2", "NULL");
INSERT INTO "results" VALUES ("22", "2", "NULL");
INSERT INTO "results" VALUES ("23", "2", "NULL");
INSERT INTO "results" VALUES ("24", "2", "NULL");
INSERT INTO "results" VALUES ("25", "3", "1:25:00.000");
INSERT INTO "results" VALUES ("26", "3", "1:25:01.000");
INSERT INTO "results" VALUES ("27", "3", "1:25:02.000");
INSERT INTO "results" VALUES ("28", "3", "1:25:03.000");
INSERT INTO "results" VALUES ("29", "3", "1:25:04.000");
INSERT INTO "results" VALUES ("30", "3", "1:25:05.000");
INSERT INTO "results" VALUES ("31", "3", "1:25:06.000");
INSERT INTO "results" VALUES ("32", "3", "1:25:07.000");
INSERT INTO "results" VALUES ("33", "3", "1:25:08.000");
INSERT INTO "results" VALUES ("34", "3", "1:25:09.000");
INSERT INTO "results" VALUES ("35", "3", "1:25:10.000");
INSERT INTO "results" VALUES ("36", "3", "1:25:11.000");
INSERT INTO "results" VALUES ("37", "3", "1:25:12.000");
INSERT INTO "results" VALUES ("38", "3", "1:25:13.000");
INSERT INTO "results" VALUES ("39", "3", "1:25:14.000");
INSERT INTO "results" VALUES ("40", "3", "1:25:15.000");
INSERT INTO "results" VALUES ("41", "3", "1:25:16.000");
INSERT INTO "results" VALUES ("42", "3", "1:25:17.000");
INSERT INTO "results" VALUES ("43", "3", "1:25:18.000");
INSERT INTO "results" VALUES ("44", "3", "1:25:19.000");
INSERT INTO "results" VALUES ("45", "4", "1:35:00.000");
INSERT INTO "results" VALUES ("46", "4", "1:35:01.000");
INSERT INTO "results" VALUES ("47", "4", "1:35:02.000");
INSERT INTO "results" VALUES ("48", "4", "1:35:03.000");
INSERT INTO "results" VALUES ("49", "4", "1:35:04.000");
INSERT INTO "results" VALUES ("50", "4", "1:35:05.000");
INSERT INTO "results" VALUES ("51", "4", "1:35:06.000");
INSERT INTO "results" VALUES ("52", "4", "1:35:07.000");
INSERT INTO "results" VALUES ("53", "4", "1:35:08.000");
INSERT INTO "results" VALUES ("54", "4", "1:35:09.000");
INSERT INTO "results" VALUES ("55", "4", "1:35:10.000");
INSERT INTO "results" VALUES ("56", "4", "1:35:11.000");
INSERT INTO "results" VALUES ("57", "4", "1:35:12.000");
INSERT INTO "results" VALUES ("58", "4", "1:35:13.000");
INSERT INTO "results" VALUES ("59", "4", "1:35:14.000");
INSERT INTO "results" VALUES ("60", "4", "1:35:15.000");
INSERT INTO "results" VALUES ("61", "4", "1:35:16.000");
INSERT INTO "results" VALUES ("62", "4", "1:35:17.000");
INSERT INTO "results" VALUES ("63", "4", "NULL");
INSERT INTO "results" VALUES ("64", "4", "NULL");
INSERT INTO "results" VALUES ("65", "5", "1:32:00.000");
INSERT INTO "results" VALUES ("66", "5", "1:32:01.000");
INSERT INTO "results" VALUES ("67", "5", "1:32:02.000");
INSERT INTO "results" VALUES ("68", "5", "1:32:03.000");
INSERT INTO "results" VALUES ("69", "5", "1:32:04.000");
INSERT INTO "results" VALUES ("70", "5", "1:32:05.000");
INSERT INTO "results" VALUES ("71", "5", "1:32:06.000");
INSERT INTO "results" VALUES ("72", "5", "1:32:07.000");
INSERT INTO "results" VALUES ("73", "5", "1:32:08.000");
INSERT INTO "results" VALUES ("74", "5", "1:32:09.000");
INSERT INTO "results" VALUES ("75", "5", "1:32:10.000");
INSERT INTO "results" VALUES ("76", "5", "1:32:11.000");
INSERT INTO "results" VALUES ("77", "5", "1:32:12.000");
INSERT INTO "results" VALUES ("78", "5", "1:32:13.000");
INSERT INTO "results" VALUES ("79", "5", "1:32:14.000");
INSERT INTO "results" VALUES ("80", "5", "1:32:15.000");
INSERT INTO "results" VALUES ("81", "5", "1:32:16.000");
INSERT INTO "results" VALUES ("82", "5", "1:32:17.000");
INSERT INTO "results" VALUES ("83", "5", "1:32:18.000");
INSERT INTO "results" VALUES ("84", "5", "1:32:19.000");
INSERT INTO "results" VALUES ("85", "5", "NULL");
INSERT INTO "results" VALUES ("86", "6", "1:28:00.000");
INSERT INTO "results" VALUES ("87", "6", "1:28:01.000");
INSERT INTO "results" VALUES ("88", "6", "1:28:02.000");
INSERT INTO "results" VALUES ("89", "6", "1:28:03.000");
INSERT INTO "results" VALUES ("90", "6", "1:28:04.000");
INSERT INTO "results" VALUES ("91", "6", "1:28:05.000");
INSERT INTO "results" VALUES ("92", "6", "1:28:06.000");
INSERT INTO "results" VALUES ("93", "6", "1:28:07.000");
INSERT INTO "results" VALUES ("94", "6", "1:28:08.000");
INSERT INTO "results" VALUES ("95", "6", "1:28:09.000");
INSERT INTO "results" VALUES ("96", "6", "1:28:10.000");
INSERT INTO "results" VALUES ("97", "6", "1:28:11.000");
INSERT INTO "results" VALUES ("98", "6", "1:28:12.000");
INSERT INTO "results" VALUES ("99", "6", "1:28:13.000");
INSERT INTO "results" VALUES ("100", "6", "1:28:14.000");
INSERT INTO "results" VALUES ("101", "6", "1:28:15.000");
INSERT INTO "results" VALUES ("102", "6", "1:28:16.000");
INSERT INTO "results" VALUES ("103", "6", "1:28:17.000");
INSERT INTO "results" VALUES ("104", "6", "1:28:18.000");
INSERT INTO "results" VALUES ("105", "6", "1:28:19.000");
INSERT INTO "results" VALUES ("106", "6", "1:28:20.000");
INSERT INTO "results" VALUES ("107", "6", "1:28:21.000");
INSERT INTO "results" VALUES ("108", "6", "1:28:22.000");
INSERT INTO "results" VALUES ("109", "6", "1:28:23.000");
INSERT INTO "results" VALUES ("110", "6", "1:28:24.000");
INSERT INTO "results" VALUES ("111", "7", "1:30:00.000");
INSERT INTO "results" VALUES ("112", "7", "1:30:01.000");
INSERT INTO "results" VALUES ("113", "7", "1:30:02.000");
INSERT INTO "results" VALUES ("114", "7", "1:30:03.000");
INSERT INTO "results" VALUES ("115", "7", "1:30:04.000");
INSERT INTO "results" VALUES ("116", "7", "1:30:05.000");
INSERT INTO "results" VALUES ("117", "7", "1:30:06.000");
INSERT INTO "results" VALUES ("118", "7", "1:30:07.000");
INSERT INTO "results" VALUES ("119", "7", "1:30:08.000");
INSERT INTO "results" VALUES ("120", "7", "1:30:09.000");
INSERT INTO "results" VALUES ("121", "7", "1:30:10.000");
INSERT INTO "results" VALUES ("122", "7", "1:30:11.000");
INSERT INTO "results" VALUES ("123", "7", "1:30:12.000");
INSERT INTO "results" VALUES ("124", "7", "1:30:13.000");
INSERT INTO "results" VALUES ("125", "7", "1:30:14.000");
INSERT INTO "results" VALUES ("126", "7", "1:30:15.000");
INSERT INTO "results" VALUES ("127", "7", "1:30:16.000");
INSERT INTO "results" VALUES ("128", "7", "1:30:17.000");
INSERT INTO "results" VALUES ("129", "7", "1:30:18.000");
INSERT INTO "results" VALUES ("130", "7", "1:30:19.000");
INSERT INTO "results" VALUES ("131", "7", "NULL");
INSERT INTO "results" VALUES ("132", "7", "NULL");
INSERT INTO "results" VALUES ("133", "8", "1:20:00.000");
INSERT INTO "results" VALUES ("134", "8", "1:20:01.000");
INSERT INTO "results" VALUES ("135", "8", "1:20:02.000");
INSERT INTO "results" VALUES ("136", "8", "1:20:03.000");
INSERT INTO "results" VALUES ("137", "8", "1:20:04.000");
INSERT INTO "results" VALUES ("138", "8", "1:20:05.000");
INSERT INTO "results" VALUES ("139", "8", "1:20:06.000");
INSERT INTO "results" VALUES ("140", "8", "1:20:07.000");
INSERT INTO "results" VALUES ("141", "8", "1:20:08.000");
INSERT INTO "results" VALUES ("142", "8", "1:20:09.000");
INSERT INTO "results" VALUES ("143", "8", "1:20:10.000");
INSERT INTO "results" VALUES ("144", "8", "1:20:11.000");
INSERT INTO "results" VALUES ("145", "8", "1:20:12.000");
INSERT INTO "results" VALUES ("146", "8", "1:20:13.000");
INSERT INTO "results" VALUES ("147", "8", "1:20:14.000");
INSERT INTO "results" VALUES ("148", "8", "1:20:15.000");
INSERT INTO "results" VALUES ("149", "8", "1:20:16.000");
INSERT INTO "results" VALUES ("150", "8", "1:20:17.000");
INSERT INTO "results" VALUES ("151", "8", "1:20:18.000");
INSERT INTO "results" VALUES ("152", "8", "1:20:19.000");
INSERT INTO "results" VALUES ("153", "8", "1:20:20.000");
INSERT INTO "results" VALUES ("154", "8", "1:20:21.000");
INSERT INTO "results" VALUES ("155", "8", "1:20:22.000");
INSERT INTO "results" VALUES ("156", "8", "1:20:23.000");
INSERT INTO "results" VALUES ("157", "8", "1:20:24.000");
INSERT INTO "results" VALUES ("158", "8", "1:20:25.000");
INSERT INTO "results" VALUES ("159", "8", "1:20:26.000");
INSERT INTO "results" VALUES ("160", "8", "1:20:27.000");
INSERT INTO "results" VALUES ("161", "8", "1:20:28.000");
INSERT INTO "results" VALUES ("162", "8", "1:20:29.000");