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

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



INSERT INTO "constructors" VALUES ("1", "Red Bull Racing", "https://www.redbullracing.com");
INSERT INTO "constructors" VALUES ("2", "Mercedes", "https://www.mercedesamgf1.com");
INSERT INTO "constructors" VALUES ("3", "Ferrari", "https://www.ferrari.com/en-EN/formula1");
INSERT INTO "constructors" VALUES ("4", "McLaren", "https://www.mclaren.com/racing/");
INSERT INTO "constructors" VALUES ("5", "Alpine", "https://www.alpinecars.com/en/formula-1/");
INSERT INTO "constructorStandings" VALUES ("101", "1", "585.5", "15");
INSERT INTO "constructorStandings" VALUES ("102", "2", "600.0", "18");
INSERT INTO "constructorStandings" VALUES ("103", "3", "450.0", "10");
INSERT INTO "constructorStandings" VALUES ("104", "4", "320.0", "5");
INSERT INTO "constructorStandings" VALUES ("105", "5", "280.0", "3");
INSERT INTO "constructorResults" VALUES ("201", "25.0");
INSERT INTO "constructorResults" VALUES ("202", "18.0");
INSERT INTO "constructorResults" VALUES ("203", "15.0");
INSERT INTO "constructorResults" VALUES ("204", "12.0");
INSERT INTO "constructorResults" VALUES ("205", "10.0");
INSERT INTO "constructorResults" VALUES ("206", "8.0");
INSERT INTO "constructorResults" VALUES ("207", "6.0");
INSERT INTO "constructorResults" VALUES ("208", "4.0");
INSERT INTO "constructorResults" VALUES ("209", "2.0");
INSERT INTO "constructorResults" VALUES ("210", "1.0");