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 "driverStandings" (
"driverStandingsId" INT,
"points" FLOAT,
PRIMARY KEY ("driverStandingsId")
);

CREATE TABLE "lapTimes" (
"raceId" INT,
"driverId" INT,
"lap" INT,
"position" INT,
"time" TEXT,
"milliseconds" INT,
PRIMARY KEY ("raceId", "driverId", "lap"),
FOREIGN KEY ("driverId") REFERENCES "drivers"("driverId")
);

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

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



INSERT INTO "driverStandings" VALUES ("1", "150.0");
INSERT INTO "driverStandings" VALUES ("2", "140.5");
INSERT INTO "driverStandings" VALUES ("3", "130.0");
INSERT INTO "driverStandings" VALUES ("4", "120.0");
INSERT INTO "driverStandings" VALUES ("5", "110.0");
INSERT INTO "driverStandings" VALUES ("6", "100.0");
INSERT INTO "driverStandings" VALUES ("7", "90.0");
INSERT INTO "driverStandings" VALUES ("8", "80.0");
INSERT INTO "driverStandings" VALUES ("9", "70.0");
INSERT INTO "driverStandings" VALUES ("10", "60.0");
INSERT INTO "driverStandings" VALUES ("11", "50.0");
INSERT INTO "driverStandings" VALUES ("12", "40.0");
INSERT INTO "driverStandings" VALUES ("13", "30.0");
INSERT INTO "driverStandings" VALUES ("14", "20.0");
INSERT INTO "driverStandings" VALUES ("15", "15.0");
INSERT INTO "driverStandings" VALUES ("16", "10.0");
INSERT INTO "driverStandings" VALUES ("17", "5.0");
INSERT INTO "driverStandings" VALUES ("18", "3.0");
INSERT INTO "driverStandings" VALUES ("19", "2.0");
INSERT INTO "driverStandings" VALUES ("20", "1.0");
INSERT INTO "driverStandings" VALUES ("21", "0.5");
INSERT INTO "drivers" VALUES ("1", "Lewis", "Hamilton");
INSERT INTO "drivers" VALUES ("2", "Max", "Verstappen");
INSERT INTO "drivers" VALUES ("3", "Sebastian", "Vettel");
INSERT INTO "drivers" VALUES ("4", "Fernando", "Alonso");
INSERT INTO "drivers" VALUES ("5", "Kimi", "Raikkonen");
INSERT INTO "drivers" VALUES ("6", "Valtteri", "Bottas");
INSERT INTO "drivers" VALUES ("7", "Charles", "Leclerc");
INSERT INTO "drivers" VALUES ("8", "Daniel", "Ricciardo");
INSERT INTO "drivers" VALUES ("9", "Sergio", "Perez");
INSERT INTO "drivers" VALUES ("10", "Lando", "Norris");
INSERT INTO "drivers" VALUES ("11", "George", "Russell");
INSERT INTO "drivers" VALUES ("12", "Carlos", "Sainz");
INSERT INTO "drivers" VALUES ("13", "Esteban", "Ocon");
INSERT INTO "drivers" VALUES ("14", "Pierre", "Gasly");
INSERT INTO "drivers" VALUES ("15", "Mick", "Schumacher");
INSERT INTO "drivers" VALUES ("16", "Yuki", "Tsunoda");
INSERT INTO "drivers" VALUES ("17", "Nicholas", "Latifi");
INSERT INTO "drivers" VALUES ("18", "Lance", "Stroll");
INSERT INTO "drivers" VALUES ("19", "Sebastian", "Buemi");
INSERT INTO "drivers" VALUES ("20", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("21", "Nico", "Hulkenberg");
INSERT INTO "lapTimes" VALUES ("101", "1", "1", "5", "1:15.678", "75678");
INSERT INTO "lapTimes" VALUES ("101", "2", "1", "3", "1:14.500", "74500");
INSERT INTO "lapTimes" VALUES ("101", "3", "1", "7", "1:16.000", "76000");
INSERT INTO "lapTimes" VALUES ("101", "4", "1", "10", "1:17.200", "77200");
INSERT INTO "lapTimes" VALUES ("101", "5", "1", "12", "1:18.000", "78000");
INSERT INTO "lapTimes" VALUES ("101", "6", "1", "8", "1:15.000", "75000");
INSERT INTO "lapTimes" VALUES ("101", "7", "1", "1", "1:12.345", "72345");
INSERT INTO "lapTimes" VALUES ("101", "8", "1", "9", "1:15.900", "75900");
INSERT INTO "lapTimes" VALUES ("101", "9", "1", "11", "1:16.500", "76500");
INSERT INTO "lapTimes" VALUES ("101", "10", "1", "6", "1:14.800", "74800");
INSERT INTO "lapTimes" VALUES ("101", "11", "1", "13", "1:18.500", "78500");
INSERT INTO "lapTimes" VALUES ("101", "12", "1", "14", "1:19.000", "79000");
INSERT INTO "lapTimes" VALUES ("101", "13", "1", "15", "1:20.000", "80000");
INSERT INTO "lapTimes" VALUES ("101", "14", "1", "16", "1:21.000", "81000");
INSERT INTO "lapTimes" VALUES ("101", "15", "1", "17", "1:22.000", "82000");
INSERT INTO "lapTimes" VALUES ("101", "16", "1", "18", "1:23.000", "83000");
INSERT INTO "lapTimes" VALUES ("101", "17", "1", "19", "1:24.000", "84000");
INSERT INTO "lapTimes" VALUES ("101", "18", "1", "20", "1:25.000", "85000");
INSERT INTO "lapTimes" VALUES ("101", "19", "1", "21", "1:26.000", "86000");
INSERT INTO "lapTimes" VALUES ("101", "20", "1", "22", "1:27.000", "87000");
INSERT INTO "lapTimes" VALUES ("101", "21", "1", "2", "1:10.000", "70000");
INSERT INTO "results" VALUES ("1", "1", "1:12.345");
INSERT INTO "results" VALUES ("2", "2", "1:14.500");
INSERT INTO "results" VALUES ("3", "3", "1:16.000");