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,
"raceId" INT,
"driverId" INT,
"points" FLOAT,
"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,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

CREATE TABLE "races" (
"raceId" 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");
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", "British");
INSERT INTO "drivers" VALUES ("2", "Max", "Verstappen", "Dutch");
INSERT INTO "drivers" VALUES ("3", "Charles", "Leclerc", "Monegasque");
INSERT INTO "drivers" VALUES ("4", "Sergio", "Perez", "Mexican");
INSERT INTO "drivers" VALUES ("5", "Fernando", "Alonso", "Spanish");
INSERT INTO "drivers" VALUES ("6", "George", "Russell", "British");
INSERT INTO "drivers" VALUES ("7", "Carlos", "Sainz", "Spanish");
INSERT INTO "drivers" VALUES ("8", "Lando", "Norris", "British");
INSERT INTO "drivers" VALUES ("9", "Daniel", "Ricciardo", "Australian");
INSERT INTO "drivers" VALUES ("10", "Valtteri", "Bottas", "Finnish");
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 "races" VALUES ("4", "Azerbaijan Grand Prix");
INSERT INTO "races" VALUES ("5", "Miami Grand Prix");
INSERT INTO "races" VALUES ("6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("7", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("9", "Austrian Grand Prix");
INSERT INTO "races" VALUES ("10", "British Grand Prix");
INSERT INTO "driverStandings" VALUES ("1", "1", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("2", "1", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("3", "1", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("4", "2", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("5", "2", "1", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("6", "2", "4", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("7", "3", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("8", "3", "3", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("9", "3", "2", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("10", "4", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("11", "4", "4", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("12", "4", "1", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("13", "5", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("14", "5", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("15", "5", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("16", "6", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("17", "6", "1", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("18", "6", "4", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("19", "7", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("20", "7", "3", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("21", "7", "2", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("22", "8", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("23", "8", "4", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("24", "8", "1", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("25", "9", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("26", "9", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("27", "9", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("28", "10", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("29", "10", "1", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("30", "10", "4", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("31", "1", "5", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("32", "2", "5", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("33", "3", "6", "8.0", "0");
INSERT INTO "driverStandings" VALUES ("34", "4", "7", "6.0", "0");
INSERT INTO "driverStandings" VALUES ("35", "5", "8", "4.0", "0");
INSERT INTO "driverStandings" VALUES ("36", "6", "9", "2.0", "0");
INSERT INTO "driverStandings" VALUES ("37", "7", "10", "1.0", "0");
INSERT INTO "driverStandings" VALUES ("38", "8", "5", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("39", "9", "6", "8.0", "0");
INSERT INTO "driverStandings" VALUES ("40", "10", "7", "6.0", "0");
INSERT INTO "results" VALUES ("1", "1");
INSERT INTO "results" VALUES ("2", "2");
INSERT INTO "results" VALUES ("3", "3");
INSERT INTO "results" VALUES ("4", "1");
INSERT INTO "results" VALUES ("5", "2");
INSERT INTO "results" VALUES ("6", "3");
INSERT INTO "results" VALUES ("7", "1");
INSERT INTO "results" VALUES ("8", "2");
INSERT INTO "results" VALUES ("9", "3");
INSERT INTO "results" VALUES ("10", "1");
INSERT INTO "results" VALUES ("11", "2");
INSERT INTO "results" VALUES ("12", "3");
INSERT INTO "results" VALUES ("13", "1");
INSERT INTO "results" VALUES ("14", "2");
INSERT INTO "results" VALUES ("15", "3");
INSERT INTO "results" VALUES ("16", "1");
INSERT INTO "results" VALUES ("17", "2");
INSERT INTO "results" VALUES ("18", "3");
INSERT INTO "results" VALUES ("19", "1");
INSERT INTO "results" VALUES ("20", "2");
INSERT INTO "results" VALUES ("21", "3");
INSERT INTO "results" VALUES ("22", "1");
INSERT INTO "results" VALUES ("23", "2");
INSERT INTO "results" VALUES ("24", "3");
INSERT INTO "results" VALUES ("25", "1");
INSERT INTO "results" VALUES ("26", "2");
INSERT INTO "results" VALUES ("27", "3");
INSERT INTO "results" VALUES ("28", "1");
INSERT INTO "results" VALUES ("29", "2");
INSERT INTO "results" VALUES ("30", "3");
INSERT INTO "results" VALUES ("31", "4");
INSERT INTO "results" VALUES ("32", "5");
INSERT INTO "results" VALUES ("33", "6");
INSERT INTO "results" VALUES ("34", "7");
INSERT INTO "results" VALUES ("35", "8");
INSERT INTO "results" VALUES ("36", "9");
INSERT INTO "results" VALUES ("37", "10");
INSERT INTO "results" VALUES ("38", "4");
INSERT INTO "results" VALUES ("39", "5");
INSERT INTO "results" VALUES ("40", "6");