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

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

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

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



INSERT INTO "constructors" VALUES ("1", "Italian", "http://ferrari.com");
INSERT INTO "constructors" VALUES ("2", "British", "http://mercedes.com");
INSERT INTO "constructors" VALUES ("3", "Italian", "http://alfaromeo.com");
INSERT INTO "constructors" VALUES ("4", "German", "http://audi.com");
INSERT INTO "constructors" VALUES ("5", "Italian", "http://lamborghini.com");
INSERT INTO "constructors" VALUES ("6", "French", "http://renault.com");
INSERT INTO "constructors" VALUES ("7", "Italian", "http://maserati.com");
INSERT INTO "races" VALUES ("101", "2018");
INSERT INTO "races" VALUES ("102", "2019");
INSERT INTO "races" VALUES ("103", "2020");
INSERT INTO "races" VALUES ("104", "2021");
INSERT INTO "races" VALUES ("105", "2022");
INSERT INTO "constructorStandings" VALUES ("1001", "101", "1", "150.5");
INSERT INTO "constructorStandings" VALUES ("1002", "102", "1", "160.0");
INSERT INTO "constructorStandings" VALUES ("1003", "103", "1", "140.0");
INSERT INTO "constructorStandings" VALUES ("1004", "104", "1", "155.0");
INSERT INTO "constructorStandings" VALUES ("1005", "105", "1", "165.0");
INSERT INTO "constructorStandings" VALUES ("1006", "101", "3", "80.0");
INSERT INTO "constructorStandings" VALUES ("1007", "102", "3", "90.0");
INSERT INTO "constructorStandings" VALUES ("1008", "103", "3", "85.0");
INSERT INTO "constructorStandings" VALUES ("1009", "104", "3", "95.0");
INSERT INTO "constructorStandings" VALUES ("1010", "105", "3", "100.0");
INSERT INTO "constructorStandings" VALUES ("1011", "101", "5", "0.0");
INSERT INTO "constructorStandings" VALUES ("1012", "102", "5", "0.0");
INSERT INTO "constructorStandings" VALUES ("1013", "103", "5", "0.0");
INSERT INTO "constructorStandings" VALUES ("1014", "104", "5", "0.0");
INSERT INTO "constructorStandings" VALUES ("1015", "105", "5", "0.0");
INSERT INTO "constructorStandings" VALUES ("1016", "101", "7", "50.0");
INSERT INTO "constructorStandings" VALUES ("1017", "102", "7", "60.0");
INSERT INTO "constructorStandings" VALUES ("1018", "103", "7", "55.0");
INSERT INTO "constructorStandings" VALUES ("1019", "104", "7", "65.0");
INSERT INTO "constructorStandings" VALUES ("1020", "105", "7", "70.0");
INSERT INTO "constructorStandings" VALUES ("1021", "101", "2", "200.0");
INSERT INTO "constructorStandings" VALUES ("1022", "102", "2", "210.0");
INSERT INTO "constructorStandings" VALUES ("1023", "103", "2", "220.0");
INSERT INTO "constructorStandings" VALUES ("1024", "104", "2", "230.0");
INSERT INTO "constructorStandings" VALUES ("1025", "105", "2", "240.0");
INSERT INTO "constructorStandings" VALUES ("1026", "101", "4", "120.0");
INSERT INTO "constructorStandings" VALUES ("1027", "102", "4", "130.0");
INSERT INTO "constructorStandings" VALUES ("1028", "103", "4", "125.0");
INSERT INTO "constructorStandings" VALUES ("1029", "104", "4", "135.0");
INSERT INTO "constructorStandings" VALUES ("1030", "105", "4", "140.0");
INSERT INTO "constructorStandings" VALUES ("1031", "101", "6", "110.0");
INSERT INTO "constructorStandings" VALUES ("1032", "102", "6", "115.0");
INSERT INTO "constructorStandings" VALUES ("1033", "103", "6", "120.0");
INSERT INTO "constructorStandings" VALUES ("1034", "104", "6", "125.0");
INSERT INTO "constructorStandings" VALUES ("1035", "105", "6", "130.0");
INSERT INTO "constructorResults" VALUES ("1", "770.5");
INSERT INTO "constructorResults" VALUES ("2", "1100.0");
INSERT INTO "constructorResults" VALUES ("3", "450.0");
INSERT INTO "constructorResults" VALUES ("4", "650.0");
INSERT INTO "constructorResults" VALUES ("5", "0.0");
INSERT INTO "constructorResults" VALUES ("6", "600.0");
INSERT INTO "constructorResults" VALUES ("7", "300.0");
INSERT INTO "results" VALUES ("1", "25.0");
INSERT INTO "results" VALUES ("2", "18.0");
INSERT INTO "results" VALUES ("3", "15.0");
INSERT INTO "results" VALUES ("4", "12.0");
INSERT INTO "results" VALUES ("5", "10.0");
INSERT INTO "results" VALUES ("6", "8.0");
INSERT INTO "results" VALUES ("7", "6.0");