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

CREATE TABLE "constructorStandings" (
"constructorStandingsId" INT,
"raceId" INT,
"constructorId" INT,
"wins" INT,
PRIMARY KEY ("constructorStandingsId"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId"),
FOREIGN KEY ("constructorId") REFERENCES "constructors"("constructorId")
);

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

CREATE TABLE "drivers" (
"driverId" INT,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

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



INSERT INTO "constructorResults" VALUES ("1", "15.0");
INSERT INTO "constructorResults" VALUES ("2", "10.0");
INSERT INTO "constructorResults" VALUES ("3", "8.0");
INSERT INTO "constructorResults" VALUES ("4", "6.0");
INSERT INTO "constructorResults" VALUES ("5", "4.0");
INSERT INTO "constructorResults" VALUES ("6", "2.0");
INSERT INTO "constructorResults" VALUES ("7", "1.0");
INSERT INTO "constructorResults" VALUES ("8", "0.0");
INSERT INTO "constructorResults" VALUES ("9", "0.0");
INSERT INTO "constructorResults" VALUES ("10", "0.0");
INSERT INTO "constructors" VALUES ("1", "Mercedes", "http://www.mercedesamgf1.com/");
INSERT INTO "constructors" VALUES ("2", "Red Bull", "http://redbullracing.redbull.com/");
INSERT INTO "constructors" VALUES ("3", "Ferrari", "http://formula1.ferrari.com/en/");
INSERT INTO "constructors" VALUES ("4", "McLaren", "http://www.mclaren.com/formula1/");
INSERT INTO "constructors" VALUES ("5", "Alpine", "https://www.alpinecars.com/en/formula-1/");
INSERT INTO "constructors" VALUES ("6", "Aston Martin", "https://www.astonmartinf1.com/");
INSERT INTO "constructors" VALUES ("7", "Williams", "https://www.williamsf1.com/");
INSERT INTO "constructors" VALUES ("8", "AlphaTauri", "https://www.scuderiaalphatauri.com/");
INSERT INTO "constructors" VALUES ("9", "Sauber", "https://www.sauber-group.com/motorsport/formula-1/");
INSERT INTO "constructors" VALUES ("10", "Haas F1 Team", "https://www.haasf1team.com/");
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", "Emilia Romagna Grand Prix");
INSERT INTO "races" VALUES ("5", "Miami Grand Prix");
INSERT INTO "races" VALUES ("6", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("7", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("8", "Azerbaijan Grand Prix");
INSERT INTO "races" VALUES ("9", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("10", "British Grand Prix");
INSERT INTO "constructorStandings" VALUES ("1", "1", "1", "1");
INSERT INTO "constructorStandings" VALUES ("2", "1", "2", "0");
INSERT INTO "constructorStandings" VALUES ("3", "1", "3", "0");
INSERT INTO "constructorStandings" VALUES ("4", "2", "1", "0");
INSERT INTO "constructorStandings" VALUES ("5", "2", "2", "1");
INSERT INTO "constructorStandings" VALUES ("6", "2", "3", "0");
INSERT INTO "constructorStandings" VALUES ("7", "3", "1", "1");
INSERT INTO "constructorStandings" VALUES ("8", "3", "2", "0");
INSERT INTO "constructorStandings" VALUES ("9", "3", "3", "0");
INSERT INTO "constructorStandings" VALUES ("10", "4", "1", "0");
INSERT INTO "constructorStandings" VALUES ("11", "4", "2", "1");
INSERT INTO "constructorStandings" VALUES ("12", "4", "3", "0");
INSERT INTO "constructorStandings" VALUES ("13", "5", "1", "0");
INSERT INTO "constructorStandings" VALUES ("14", "5", "2", "0");
INSERT INTO "constructorStandings" VALUES ("15", "5", "3", "1");
INSERT INTO "constructorStandings" VALUES ("16", "6", "1", "1");
INSERT INTO "constructorStandings" VALUES ("17", "6", "2", "0");
INSERT INTO "constructorStandings" VALUES ("18", "6", "3", "0");
INSERT INTO "constructorStandings" VALUES ("19", "7", "1", "0");
INSERT INTO "constructorStandings" VALUES ("20", "7", "2", "1");
INSERT INTO "constructorStandings" VALUES ("21", "7", "3", "0");
INSERT INTO "constructorStandings" VALUES ("22", "8", "1", "0");
INSERT INTO "constructorStandings" VALUES ("23", "8", "2", "0");
INSERT INTO "constructorStandings" VALUES ("24", "8", "3", "1");
INSERT INTO "constructorStandings" VALUES ("25", "9", "1", "1");
INSERT INTO "constructorStandings" VALUES ("26", "9", "2", "0");
INSERT INTO "constructorStandings" VALUES ("27", "9", "3", "0");
INSERT INTO "constructorStandings" VALUES ("28", "10", "1", "0");
INSERT INTO "constructorStandings" VALUES ("29", "10", "2", "1");
INSERT INTO "constructorStandings" VALUES ("30", "10", "3", "0");
INSERT INTO "constructorStandings" VALUES ("31", "1", "4", "0");
INSERT INTO "constructorStandings" VALUES ("32", "2", "4", "0");
INSERT INTO "constructorStandings" VALUES ("33", "3", "4", "0");
INSERT INTO "constructorStandings" VALUES ("34", "4", "4", "0");
INSERT INTO "constructorStandings" VALUES ("35", "5", "4", "0");
INSERT INTO "constructorStandings" VALUES ("36", "6", "4", "0");
INSERT INTO "constructorStandings" VALUES ("37", "7", "4", "0");
INSERT INTO "constructorStandings" VALUES ("38", "8", "4", "0");
INSERT INTO "constructorStandings" VALUES ("39", "9", "4", "0");
INSERT INTO "constructorStandings" VALUES ("40", "10", "4", "0");
INSERT INTO "constructorStandings" VALUES ("41", "1", "5", "0");
INSERT INTO "constructorStandings" VALUES ("42", "2", "5", "0");
INSERT INTO "constructorStandings" VALUES ("43", "3", "5", "0");
INSERT INTO "constructorStandings" VALUES ("44", "4", "5", "0");
INSERT INTO "constructorStandings" VALUES ("45", "5", "5", "0");
INSERT INTO "constructorStandings" VALUES ("46", "6", "5", "0");
INSERT INTO "constructorStandings" VALUES ("47", "7", "5", "0");
INSERT INTO "constructorStandings" VALUES ("48", "8", "5", "0");
INSERT INTO "constructorStandings" VALUES ("49", "9", "5", "0");
INSERT INTO "constructorStandings" VALUES ("50", "10", "5", "0");
INSERT INTO "drivers" VALUES ("1", "British");
INSERT INTO "drivers" VALUES ("2", "Dutch");
INSERT INTO "drivers" VALUES ("3", "Monegasque");
INSERT INTO "drivers" VALUES ("4", "Mexican");
INSERT INTO "drivers" VALUES ("5", "Spanish");
INSERT INTO "drivers" VALUES ("6", "French");
INSERT INTO "drivers" VALUES ("7", "German");
INSERT INTO "drivers" VALUES ("8", "Thai");
INSERT INTO "drivers" VALUES ("9", "Finnish");
INSERT INTO "drivers" VALUES ("10", "Canadian");