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 "pitStops" (
"raceId" INT,
"driverId" INT,
"stop" INT,
"duration" TEXT,
PRIMARY KEY ("raceId", "driverId", "stop"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId"),
FOREIGN KEY ("driverId") REFERENCES "drivers"("driverId")
);

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

CREATE TABLE "drivers" (
"driverId" INT UNIQUE,
"forename" TEXT,
"surname" TEXT,
PRIMARY KEY ("driverId")
);

CREATE TABLE "qualifying" (
"qualifyId" INT,
"position" INT,
PRIMARY KEY ("qualifyId")
);

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

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



INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull Racing");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
INSERT INTO "constructors" VALUES ("4", "McLaren");
INSERT INTO "constructors" VALUES ("5", "Aston Martin");
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", "Lando", "Norris");
INSERT INTO "drivers" VALUES ("5", "Fernando", "Alonso");
INSERT INTO "drivers" VALUES ("6", "Sergio", "Perez");
INSERT INTO "drivers" VALUES ("7", "Carlos", "Sainz");
INSERT INTO "drivers" VALUES ("8", "George", "Russell");
INSERT INTO "drivers" VALUES ("9", "Daniel", "Ricciardo");
INSERT INTO "drivers" VALUES ("10", "Valtteri", "Bottas");
INSERT INTO "pitStops" VALUES ("1", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("1", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("1", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("1", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("1", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("2", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("2", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("2", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("2", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("2", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("3", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("3", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("3", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("3", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("3", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("4", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("4", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("4", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("4", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("4", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("5", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("5", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("5", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("5", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("5", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("6", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("6", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("6", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("6", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("6", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("7", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("7", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("7", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("7", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("7", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("8", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("8", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("8", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("8", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("8", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("9", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("9", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("9", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("9", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("9", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("10", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("10", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("10", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("10", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("10", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("11", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("11", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("11", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("11", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("11", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("12", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("12", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("12", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("12", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("12", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("13", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("13", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("13", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("13", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("13", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("14", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("14", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("14", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("14", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("14", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("15", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("15", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("15", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("15", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("15", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("16", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("16", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("16", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("16", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("16", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("17", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("17", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("17", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("17", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("17", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("18", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("18", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("18", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("18", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("18", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("19", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("19", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("19", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("19", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("19", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("20", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("20", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("20", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("20", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("20", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("21", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("21", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("21", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("21", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("21", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("22", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("22", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("22", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("22", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("22", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("23", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("23", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("23", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("23", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("23", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("24", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("24", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("24", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("24", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("24", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("25", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("25", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("25", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("25", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("25", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("26", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("26", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("26", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("26", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("26", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("27", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("27", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("27", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("27", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("27", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("28", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("28", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("28", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("28", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("28", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("29", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("29", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("29", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("29", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("29", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("30", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("30", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("30", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("30", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("30", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("31", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("31", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("31", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("31", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("31", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("32", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("32", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("32", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("32", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("32", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("33", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("33", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("33", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("33", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("33", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("34", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("34", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("34", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("34", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("34", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("35", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("35", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("35", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("35", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("35", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("36", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("36", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("36", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("36", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("36", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("37", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("37", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("37", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("37", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("37", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("38", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("38", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("38", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("38", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("38", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("39", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("39", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("39", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("39", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("39", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("40", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("40", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("40", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("40", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("40", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("41", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("41", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("41", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("41", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("41", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("42", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("42", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("42", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("42", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("42", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("43", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("43", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("43", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("43", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("43", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("44", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("44", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("44", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("44", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("44", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("45", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("45", "2", "1", "2.300");
INSERT INTO "pitStops" VALUES ("45", "3", "1", "2.800");
INSERT INTO "pitStops" VALUES ("45", "4", "1", "2.600");
INSERT INTO "pitStops" VALUES ("45", "5", "1", "3.100");
INSERT INTO "pitStops" VALUES ("46", "1", "1", "2.400");
INSERT INTO "pitStops" VALUES ("46", "2", "1", "2.200");
INSERT INTO "pitStops" VALUES ("46", "3", "1", "2.700");
INSERT INTO "pitStops" VALUES ("46", "4", "1", "2.900");
INSERT INTO "pitStops" VALUES ("46", "5", "1", "3.500");
INSERT INTO "pitStops" VALUES ("47", "1", "1", "2.600");
INSERT INTO "pitStops" VALUES ("47", "2", "1", "2.400");
INSERT INTO "pitStops" VALUES ("47", "3", "1", "2.900");
INSERT INTO "pitStops" VALUES ("47", "4", "1", "2.700");
INSERT INTO "pitStops" VALUES ("47", "5", "1", "3.200");
INSERT INTO "pitStops" VALUES ("48", "6", "1", "2.300");
INSERT INTO "pitStops" VALUES ("48", "7", "1", "2.500");
INSERT INTO "pitStops" VALUES ("48", "8", "1", "2.800");
INSERT INTO "pitStops" VALUES ("48", "9", "1", "2.600");
INSERT INTO "pitStops" VALUES ("48", "10", "1", "3.000");
INSERT INTO "pitStops" VALUES ("49", "1", "1", "2.500");
INSERT INTO "pitStops" VALUES ("49", "2", "1", "2.300");