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,
"wins" INT,
PRIMARY KEY ("constructorStandingsId")
);

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

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



INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull Racing");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
INSERT INTO "constructors" VALUES ("4", "McLaren");
INSERT INTO "constructors" VALUES ("5", "Alpine");
INSERT INTO "constructors" VALUES ("6", "Aston Martin");
INSERT INTO "constructors" VALUES ("7", "AlphaTauri");
INSERT INTO "constructors" VALUES ("8", "Alfa Romeo");
INSERT INTO "constructors" VALUES ("9", "Haas F1 Team");
INSERT INTO "constructors" VALUES ("10", "Williams");
INSERT INTO "races" VALUES ("290", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("291", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("292", "British Grand Prix");
INSERT INTO "races" VALUES ("293", "Italian Grand Prix");
INSERT INTO "races" VALUES ("294", "Japanese Grand Prix");
INSERT INTO "constructorResults" VALUES ("1", "291", "1", "25.0");
INSERT INTO "constructorResults" VALUES ("2", "291", "2", "18.0");
INSERT INTO "constructorResults" VALUES ("3", "291", "3", "15.0");
INSERT INTO "constructorResults" VALUES ("4", "291", "4", "0.0");
INSERT INTO "constructorResults" VALUES ("5", "291", "5", "0.0");
INSERT INTO "constructorResults" VALUES ("6", "291", "6", "6.0");
INSERT INTO "constructorResults" VALUES ("7", "291", "7", "0.0");
INSERT INTO "constructorResults" VALUES ("8", "291", "8", "2.0");
INSERT INTO "constructorResults" VALUES ("9", "291", "9", "0.0");
INSERT INTO "constructorResults" VALUES ("10", "291", "10", "1.0");
INSERT INTO "constructorResults" VALUES ("11", "290", "1", "20.0");
INSERT INTO "constructorResults" VALUES ("12", "292", "2", "25.0");
INSERT INTO "constructorResults" VALUES ("13", "293", "3", "10.0");
INSERT INTO "constructorResults" VALUES ("14", "294", "4", "8.0");
INSERT INTO "constructorStandings" VALUES ("1", "1", "5");
INSERT INTO "constructorStandings" VALUES ("2", "2", "3");
INSERT INTO "constructorStandings" VALUES ("3", "3", "1");
INSERT INTO "constructorStandings" VALUES ("4", "4", "0");
INSERT INTO "constructorStandings" VALUES ("5", "5", "0");
INSERT INTO "constructorStandings" VALUES ("6", "6", "0");
INSERT INTO "constructorStandings" VALUES ("7", "7", "0");
INSERT INTO "constructorStandings" VALUES ("8", "8", "0");
INSERT INTO "constructorStandings" VALUES ("9", "9", "0");
INSERT INTO "constructorStandings" VALUES ("10", "10", "0");