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,
"raceId" INT,
"constructorId" INT,
"points" FLOAT,
PRIMARY KEY ("constructorResultsId"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId"),
FOREIGN KEY ("constructorId") REFERENCES "constructors"("constructorId")
);

CREATE TABLE "constructorStandings" (
"constructorStandingsId" INT,
"position" INT,
PRIMARY KEY ("constructorStandingsId")
);

CREATE TABLE "circuits" (
"circuitId" INT,
"name" TEXT,
PRIMARY KEY ("circuitId")
);

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

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

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



INSERT INTO "circuits" VALUES ("1", "Monaco Grand Prix");
INSERT INTO "circuits" VALUES ("2", "Silverstone Circuit");
INSERT INTO "circuits" VALUES ("3", "Circuit de Spa-Francorchamps");
INSERT INTO "circuits" VALUES ("4", "Autodromo Nazionale Monza");
INSERT INTO "circuits" VALUES ("5", "Suzuka International Racing Course");
INSERT INTO "constructors" VALUES ("1", "Ferrari", "Italian");
INSERT INTO "constructors" VALUES ("2", "McLaren", "British");
INSERT INTO "constructors" VALUES ("3", "Williams", "British");
INSERT INTO "constructors" VALUES ("4", "Mercedes", "German");
INSERT INTO "constructors" VALUES ("5", "Red Bull", "Austrian");
INSERT INTO "constructors" VALUES ("6", "Renault", "French");
INSERT INTO "constructors" VALUES ("7", "Tyrrell", "British");
INSERT INTO "constructors" VALUES ("8", "Brabham", "British");
INSERT INTO "constructors" VALUES ("9", "Lotus", "British");
INSERT INTO "constructors" VALUES ("10", "Benetton", "Italian");
INSERT INTO "races" VALUES ("1", "1980", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("2", "1985", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("3", "1990", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("4", "1995", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("5", "2000", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("6", "2005", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("7", "2010", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("8", "2011", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("9", "1979", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("10", "1980", "British Grand Prix");
INSERT INTO "races" VALUES ("11", "1990", "Italian Grand Prix");
INSERT INTO "races" VALUES ("12", "2000", "Belgian Grand Prix");
INSERT INTO "constructorResults" VALUES ("1", "1", "1", "9.0");
INSERT INTO "constructorResults" VALUES ("2", "1", "2", "6.0");
INSERT INTO "constructorResults" VALUES ("3", "2", "1", "10.0");
INSERT INTO "constructorResults" VALUES ("4", "2", "3", "8.0");
INSERT INTO "constructorResults" VALUES ("5", "3", "2", "12.0");
INSERT INTO "constructorResults" VALUES ("6", "3", "1", "4.0");
INSERT INTO "constructorResults" VALUES ("7", "4", "3", "10.0");
INSERT INTO "constructorResults" VALUES ("8", "4", "2", "6.0");
INSERT INTO "constructorResults" VALUES ("9", "5", "1", "10.0");
INSERT INTO "constructorResults" VALUES ("10", "5", "4", "8.0");
INSERT INTO "constructorResults" VALUES ("11", "6", "4", "10.0");
INSERT INTO "constructorResults" VALUES ("12", "6", "5", "6.0");
INSERT INTO "constructorResults" VALUES ("13", "7", "5", "10.0");
INSERT INTO "constructorResults" VALUES ("14", "7", "4", "8.0");
INSERT INTO "constructorResults" VALUES ("15", "8", "1", "10.0");
INSERT INTO "constructorResults" VALUES ("16", "9", "2", "5.0");
INSERT INTO "constructorResults" VALUES ("17", "10", "1", "10.0");
INSERT INTO "constructorResults" VALUES ("18", "11", "2", "8.0");
INSERT INTO "constructorResults" VALUES ("19", "12", "3", "6.0");
INSERT INTO "constructorResults" VALUES ("20", "1", "6", "2.0");
INSERT INTO "constructorResults" VALUES ("21", "2", "7", "1.0");
INSERT INTO "constructorResults" VALUES ("22", "3", "8", "3.0");
INSERT INTO "constructorResults" VALUES ("23", "4", "9", "2.0");
INSERT INTO "constructorResults" VALUES ("24", "5", "10", "5.0");
INSERT INTO "constructorResults" VALUES ("25", "6", "1", "2.0");
INSERT INTO "constructorResults" VALUES ("26", "7", "2", "4.0");
INSERT INTO "constructorStandings" VALUES ("1", "1");
INSERT INTO "constructorStandings" VALUES ("2", "2");
INSERT INTO "constructorStandings" VALUES ("3", "3");
INSERT INTO "constructorStandings" VALUES ("4", "4");
INSERT INTO "constructorStandings" VALUES ("5", "5");
INSERT INTO "results" VALUES ("1", "1");
INSERT INTO "results" VALUES ("2", "2");
INSERT INTO "results" VALUES ("3", "3");
INSERT INTO "results" VALUES ("4", "4");
INSERT INTO "results" VALUES ("5", "5");