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 "constructors" (
"constructorId" INT UNIQUE,
"name" TEXT,
PRIMARY KEY ("constructorId")
);

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



INSERT INTO "races" VALUES ("290", "Australian Grand Prix");
INSERT INTO "races" VALUES ("291", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("292", "Chinese Grand Prix");
INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull Racing");
INSERT INTO "constructors" VALUES ("3", "McLaren");
INSERT INTO "constructors" VALUES ("4", "Ferrari");
INSERT INTO "constructors" VALUES ("5", "Alpine");
INSERT INTO "constructors" VALUES ("6", "Aston Martin");
INSERT INTO "constructorResults" VALUES ("1001", "291", "1", "25.0");
INSERT INTO "constructorResults" VALUES ("1002", "291", "2", "18.0");
INSERT INTO "constructorResults" VALUES ("1003", "291", "3", "0.0");
INSERT INTO "constructorResults" VALUES ("1004", "291", "4", "0.0");
INSERT INTO "constructorResults" VALUES ("1005", "291", "5", "0.0");
INSERT INTO "constructorResults" VALUES ("1006", "291", "6", "1.0");
INSERT INTO "constructorResults" VALUES ("1007", "290", "1", "15.0");
INSERT INTO "constructorResults" VALUES ("1008", "290", "2", "12.0");
INSERT INTO "constructorResults" VALUES ("1009", "290", "3", "10.0");
INSERT INTO "constructorResults" VALUES ("1010", "290", "4", "8.0");
INSERT INTO "constructorResults" VALUES ("1011", "290", "5", "6.0");
INSERT INTO "constructorResults" VALUES ("1012", "290", "6", "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 "constructorStandings" VALUES ("6", "6");