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 "constructorStandings" (
"constructorStandingsId" INT,
"position" INT,
PRIMARY KEY ("constructorStandingsId")
);

CREATE TABLE "driverStandings" (
"driverStandingsId" INT,
"raceId" INT,
"driverId" INT,
"points" FLOAT,
"position" INT,
"wins" INT,
PRIMARY KEY ("driverStandingsId"),
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 "races" (
"raceId" INT UNIQUE,
"year" INT,
"round" INT,
"name" TEXT,
"date" DATE,
PRIMARY KEY ("raceId")
);



INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
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", "Driver91F", "Driver91S");
INSERT INTO "drivers" VALUES ("5", "Charles", "Leclerc");
INSERT INTO "drivers" VALUES ("6", "Lando", "Norris");
INSERT INTO "races" VALUES ("1", "2023", "1", "Australian Grand Prix", "2023-03-19");
INSERT INTO "races" VALUES ("2", "2023", "2", "Bahrain Grand Prix", "2023-03-26");
INSERT INTO "races" VALUES ("3", "2023", "3", "Chinese Grand Prix", "2023-04-02");
INSERT INTO "races" VALUES ("4", "2023", "4", "Spanish Grand Prix", "2023-05-07");
INSERT INTO "races" VALUES ("5", "2023", "5", "Monaco Grand Prix", "2023-05-28");
INSERT INTO "races" VALUES ("6", "2023", "6", "Canadian Grand Prix", "2023-06-11");
INSERT INTO "races" VALUES ("7", "2023", "7", "British Grand Prix", "2023-07-09");
INSERT INTO "races" VALUES ("8", "2023", "8", "Hungarian Grand Prix", "2023-07-23");
INSERT INTO "races" VALUES ("9", "2023", "9", "Belgian Grand Prix", "2023-08-27");
INSERT INTO "races" VALUES ("10", "2023", "10", "Dutch Grand Prix", "2023-09-03");
INSERT INTO "driverStandings" VALUES ("1", "1", "1", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("2", "1", "2", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("3", "1", "3", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("4", "1", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("5", "1", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("6", "1", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("7", "2", "1", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("8", "2", "2", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("9", "2", "3", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("10", "2", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("11", "2", "5", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("12", "2", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("13", "3", "1", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("14", "3", "2", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("15", "3", "3", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("16", "3", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("17", "3", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("18", "3", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("19", "4", "1", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("20", "4", "2", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("21", "4", "3", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("22", "4", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("23", "4", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("24", "4", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("25", "5", "1", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("26", "5", "2", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("27", "5", "3", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("28", "5", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("29", "5", "5", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("30", "5", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("31", "6", "1", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("32", "6", "2", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("33", "6", "3", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("34", "6", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("35", "6", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("36", "6", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("37", "7", "1", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("38", "7", "2", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("39", "7", "3", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("40", "7", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("41", "7", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("42", "7", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("43", "8", "1", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("44", "8", "2", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("45", "8", "3", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("46", "8", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("47", "8", "5", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("48", "8", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("49", "9", "1", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("50", "9", "2", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("51", "9", "3", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("52", "9", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("53", "9", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("54", "9", "6", "10.0", "5", "0");
INSERT INTO "driverStandings" VALUES ("55", "10", "1", "25.0", "1", "1");
INSERT INTO "driverStandings" VALUES ("56", "10", "2", "18.0", "2", "0");
INSERT INTO "driverStandings" VALUES ("57", "10", "3", "15.0", "3", "0");
INSERT INTO "driverStandings" VALUES ("58", "10", "4", "0.0", "91", "0");
INSERT INTO "driverStandings" VALUES ("59", "10", "5", "12.0", "4", "0");
INSERT INTO "driverStandings" VALUES ("60", "10", "6", "10.0", "5", "0");
INSERT INTO "constructorStandings" VALUES ("1", "1");
INSERT INTO "constructorStandings" VALUES ("2", "2");
INSERT INTO "constructorStandings" VALUES ("3", "3");