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", "10.0");
INSERT INTO "constructorResults" VALUES ("2", "15.0");
INSERT INTO "constructorResults" VALUES ("3", "20.0");
INSERT INTO "constructorResults" VALUES ("4", "5.0");
INSERT INTO "constructorResults" VALUES ("5", "25.0");
INSERT INTO "constructorResults" VALUES ("6", "12.0");
INSERT INTO "constructorResults" VALUES ("7", "8.0");
INSERT INTO "constructorResults" VALUES ("8", "18.0");
INSERT INTO "constructorResults" VALUES ("9", "30.0");
INSERT INTO "constructorResults" VALUES ("10", "7.0");
INSERT INTO "constructorStandings" VALUES ("1", "101", "1", "5");
INSERT INTO "constructorStandings" VALUES ("2", "102", "2", "3");
INSERT INTO "constructorStandings" VALUES ("3", "103", "3", "8");
INSERT INTO "constructorStandings" VALUES ("4", "104", "1", "2");
INSERT INTO "constructorStandings" VALUES ("5", "105", "4", "1");
INSERT INTO "constructorStandings" VALUES ("6", "106", "2", "4");
INSERT INTO "constructorStandings" VALUES ("7", "107", "3", "6");
INSERT INTO "constructorStandings" VALUES ("8", "108", "5", "10");
INSERT INTO "constructorStandings" VALUES ("9", "109", "1", "3");
INSERT INTO "constructorStandings" VALUES ("10", "110", "4", "0");
INSERT INTO "constructorStandings" VALUES ("11", "111", "5", "7");
INSERT INTO "constructors" VALUES ("1", "Mercedes", "http://www.mercedesamgf1.com");
INSERT INTO "constructors" VALUES ("2", "Red Bull Racing", "http://www.redbullracing.com");
INSERT INTO "constructors" VALUES ("3", "Ferrari", "http://www.ferrari.com");
INSERT INTO "constructors" VALUES ("4", "McLaren", "http://www.mclaren.com");
INSERT INTO "constructors" VALUES ("5", "Williams", "http://www.williamsf1.com");
INSERT INTO "constructors" VALUES ("6", "Alpine", "http://www.alpinecars.com");
INSERT INTO "drivers" VALUES ("1", "British");
INSERT INTO "drivers" VALUES ("2", "Dutch");
INSERT INTO "drivers" VALUES ("3", "Monegasque");
INSERT INTO "drivers" VALUES ("4", "Spanish");
INSERT INTO "drivers" VALUES ("5", "Mexican");
INSERT INTO "drivers" VALUES ("6", "French");
INSERT INTO "races" VALUES ("101", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("102", "Saudi Arabian Grand Prix");
INSERT INTO "races" VALUES ("103", "Australian Grand Prix");
INSERT INTO "races" VALUES ("104", "Emilia Romagna Grand Prix");
INSERT INTO "races" VALUES ("105", "Miami Grand Prix");
INSERT INTO "races" VALUES ("106", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("107", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("108", "Azerbaijan Grand Prix");
INSERT INTO "races" VALUES ("109", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("110", "British Grand Prix");
INSERT INTO "races" VALUES ("111", "Austrian Grand Prix");