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 ("constructorId") REFERENCES "constructors"("constructorId")
);

CREATE TABLE "constructorStandings" (
"constructorStandingsId" INT,
"points" FLOAT,
"wins" INT,
PRIMARY KEY ("constructorStandingsId")
);

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



INSERT INTO "constructors" VALUES ("1", "Mercedes", "http://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One");
INSERT INTO "constructors" VALUES ("2", "Red Bull", "http://en.wikipedia.org/wiki/Red_Bull_Racing");
INSERT INTO "constructors" VALUES ("3", "Ferrari", "http://en.wikipedia.org/wiki/Scuderia_Ferrari");
INSERT INTO "constructors" VALUES ("4", "McLaren", "http://en.wikipedia.org/wiki/McLaren");
INSERT INTO "constructors" VALUES ("5", "Williams", "http://en.wikipedia.org/wiki/Williams_Grand_Prix_Engineering");
INSERT INTO "constructors" VALUES ("6", "Renault", "http://en.wikipedia.org/wiki/Renault_in_Formula_One");
INSERT INTO "constructors" VALUES ("7", "Force India", "http://en.wikipedia.org/wiki/Force_India");
INSERT INTO "constructors" VALUES ("8", "Sauber", "http://en.wikipedia.org/wiki/Sauber");
INSERT INTO "constructors" VALUES ("9", "Toro Rosso", "http://en.wikipedia.org/wiki/Scuderia_Toro_Rosso");
INSERT INTO "constructors" VALUES ("10", "Haas F1 Team", "http://en.wikipedia.org/wiki/Haas_F1_Team");
INSERT INTO "constructorResults" VALUES ("1", "1", "1", "43.0");
INSERT INTO "constructorResults" VALUES ("2", "1", "2", "28.0");
INSERT INTO "constructorResults" VALUES ("3", "1", "3", "15.0");
INSERT INTO "constructorResults" VALUES ("4", "2", "1", "30.0");
INSERT INTO "constructorResults" VALUES ("5", "2", "2", "20.0");
INSERT INTO "constructorResults" VALUES ("6", "2", "3", "18.0");
INSERT INTO "constructorResults" VALUES ("7", "9", "1", "25.0");
INSERT INTO "constructorResults" VALUES ("8", "9", "2", "18.0");
INSERT INTO "constructorResults" VALUES ("9", "9", "3", "15.0");
INSERT INTO "constructorResults" VALUES ("10", "9", "4", "10.0");
INSERT INTO "constructorResults" VALUES ("11", "9", "5", "8.0");
INSERT INTO "constructorResults" VALUES ("12", "10", "1", "50.0");
INSERT INTO "constructorResults" VALUES ("13", "10", "2", "30.0");
INSERT INTO "constructorResults" VALUES ("14", "10", "3", "25.0");
INSERT INTO "constructorStandings" VALUES ("1", "43.0", "1");
INSERT INTO "constructorStandings" VALUES ("2", "28.0", "0");
INSERT INTO "constructorStandings" VALUES ("3", "15.0", "0");
INSERT INTO "constructorStandings" VALUES ("4", "73.0", "2");
INSERT INTO "constructorStandings" VALUES ("5", "48.0", "0");
INSERT INTO "constructorStandings" VALUES ("6", "33.0", "0");