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,
"driverId" INT,
"points" FLOAT,
"position" INT,
"wins" INT,
PRIMARY KEY ("driverStandingsId"),
FOREIGN KEY ("driverId") REFERENCES "drivers"("driverId")
);

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

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

CREATE TABLE "results" (
"resultId" INT,
"grid" INT,
"time" TEXT,
PRIMARY KEY ("resultId")
);



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", "Fernando", "Alonso");
INSERT INTO "drivers" VALUES ("6", "Lando", "Norris");
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 "drivers" VALUES ("11", "Sebastian", "Vettel");
INSERT INTO "drivers" VALUES ("12", "Kimi", "Raikkonen");
INSERT INTO "drivers" VALUES ("13", "Nico", "Rosberg");
INSERT INTO "drivers" VALUES ("14", "Jenson", "Button");
INSERT INTO "drivers" VALUES ("15", "Felipe", "Massa");
INSERT INTO "drivers" VALUES ("16", "Mark", "Webber");
INSERT INTO "drivers" VALUES ("17", "Romain", "Grosjean");
INSERT INTO "drivers" VALUES ("18", "Kevin", "Magnussen");
INSERT INTO "drivers" VALUES ("19", "Esteban", "Ocon");
INSERT INTO "drivers" VALUES ("20", "Pierre", "Gasly");
INSERT INTO "drivers" VALUES ("21", "Yuki", "Tsunoda");
INSERT INTO "drivers" VALUES ("22", "Alexander", "Albon");
INSERT INTO "drivers" VALUES ("23", "Lance", "Stroll");
INSERT INTO "drivers" VALUES ("24", "Zhou", "Guanyu");
INSERT INTO "drivers" VALUES ("25", "Nyck", "de Vries");
INSERT INTO "drivers" VALUES ("26", "Logan", "Sargeant");
INSERT INTO "drivers" VALUES ("27", "Nico", "Hulkenberg");
INSERT INTO "drivers" VALUES ("28", "Oscar", "Piastri");
INSERT INTO "drivers" VALUES ("29", "Liam", "Lawson");
INSERT INTO "drivers" VALUES ("30", "Daniel", "Ricciardo");
INSERT INTO "driverStandings" VALUES ("1", "1", "400.5", "1", "10");
INSERT INTO "driverStandings" VALUES ("2", "2", "380.0", "2", "8");
INSERT INTO "driverStandings" VALUES ("3", "3", "250.0", "3", "4");
INSERT INTO "driverStandings" VALUES ("4", "4", "220.0", "4", "2");
INSERT INTO "driverStandings" VALUES ("5", "5", "180.0", "5", "1");
INSERT INTO "driverStandings" VALUES ("6", "6", "150.0", "6", "0");
INSERT INTO "driverStandings" VALUES ("7", "7", "130.0", "7", "0");
INSERT INTO "driverStandings" VALUES ("8", "8", "110.0", "8", "0");
INSERT INTO "driverStandings" VALUES ("9", "9", "91.0", "9", "3");
INSERT INTO "driverStandings" VALUES ("10", "10", "90.0", "10", "1");
INSERT INTO "driverStandings" VALUES ("11", "11", "85.0", "11", "0");
INSERT INTO "driverStandings" VALUES ("12", "12", "70.0", "12", "0");
INSERT INTO "driverStandings" VALUES ("13", "13", "60.0", "13", "0");
INSERT INTO "driverStandings" VALUES ("14", "14", "55.0", "14", "0");
INSERT INTO "driverStandings" VALUES ("15", "15", "40.0", "15", "0");
INSERT INTO "driverStandings" VALUES ("16", "16", "30.0", "16", "0");
INSERT INTO "driverStandings" VALUES ("17", "17", "20.0", "17", "0");
INSERT INTO "driverStandings" VALUES ("18", "18", "15.0", "18", "0");
INSERT INTO "driverStandings" VALUES ("19", "19", "10.0", "19", "0");
INSERT INTO "driverStandings" VALUES ("20", "20", "5.0", "20", "0");
INSERT INTO "driverStandings" VALUES ("21", "21", "91.0", "21", "1");
INSERT INTO "driverStandings" VALUES ("22", "22", "91.0", "22", "5");
INSERT INTO "driverStandings" VALUES ("23", "23", "91.0", "23", "0");
INSERT INTO "driverStandings" VALUES ("24", "24", "91.0", "24", "2");
INSERT INTO "driverStandings" VALUES ("25", "25", "91.0", "25", "4");
INSERT INTO "races" VALUES ("1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("2", "Saudi Arabian Grand Prix");
INSERT INTO "races" VALUES ("3", "Australian Grand Prix");
INSERT INTO "results" VALUES ("1", "1", "1:33:00.000");
INSERT INTO "results" VALUES ("2", "2", "1:33:01.000");
INSERT INTO "results" VALUES ("3", "3", "1:33:02.000");