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,
"status" TEXT,
PRIMARY KEY ("constructorResultsId"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId")
);

CREATE TABLE "constructorStandings" (
"constructorStandingsId" INT,
"constructorId" INT,
"points" FLOAT,
PRIMARY KEY ("constructorStandingsId"),
FOREIGN KEY ("constructorId") REFERENCES "constructors"("constructorId")
);

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

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



INSERT INTO "constructors" VALUES ("1", "Ferrari", "Italian", "http://en.wikipedia.org/wiki/Ferrari");
INSERT INTO "constructors" VALUES ("2", "Mercedes", "German", "http://en.wikipedia.org/wiki/Mercedes-Benz_in_Formula_One");
INSERT INTO "constructors" VALUES ("3", "Red Bull", "British", "http://en.wikipedia.org/wiki/Red_Bull_Racing");
INSERT INTO "constructors" VALUES ("4", "McLaren", "British", "http://en.wikipedia.org/wiki/McLaren");
INSERT INTO "constructors" VALUES ("5", "Alfa Romeo", "Italian", "http://en.wikipedia.org/wiki/Alfa_Romeo_in_Formula_One");
INSERT INTO "constructors" VALUES ("6", "Williams", "British", "http://en.wikipedia.org/wiki/Williams_Grand_Prix_Engineering");
INSERT INTO "constructors" VALUES ("7", "Haas F1 Team", "American", "http://en.wikipedia.org/wiki/Haas_F1_Team");
INSERT INTO "constructors" VALUES ("8", "AlphaTauri", "Italian", "http://en.wikipedia.org/wiki/Scuderia_AlphaTauri");
INSERT INTO "constructors" VALUES ("9", "Renault", "French", "http://en.wikipedia.org/wiki/Renault_in_Formula_One");
INSERT INTO "constructors" VALUES ("10", "Aston Martin", "British", "http://en.wikipedia.org/wiki/Aston_Martin_in_Formula_One");
INSERT INTO "constructorStandings" VALUES ("1", "1", "700.5");
INSERT INTO "constructorStandings" VALUES ("2", "2", "850.0");
INSERT INTO "constructorStandings" VALUES ("3", "3", "620.0");
INSERT INTO "constructorStandings" VALUES ("4", "4", "350.0");
INSERT INTO "constructorStandings" VALUES ("5", "5", "120.0");
INSERT INTO "constructorStandings" VALUES ("6", "1", "720.0");
INSERT INTO "constructorStandings" VALUES ("7", "8", "150.0");
INSERT INTO "constructorStandings" VALUES ("8", "5", "130.0");
INSERT INTO "constructorStandings" VALUES ("9", "1", "750.0");
INSERT INTO "constructorStandings" VALUES ("10", "8", "160.0");
INSERT INTO "races" VALUES ("1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("2", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("3", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("4", "Azerbaijan Grand Prix");
INSERT INTO "races" VALUES ("5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("7", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("8", "French Grand Prix");
INSERT INTO "races" VALUES ("9", "Austrian Grand Prix");
INSERT INTO "races" VALUES ("10", "British Grand Prix");
INSERT INTO "constructorResults" VALUES ("1", "1", "Finished");
INSERT INTO "constructorResults" VALUES ("2", "2", "Finished");
INSERT INTO "constructorResults" VALUES ("3", "3", "Finished");
INSERT INTO "constructorResults" VALUES ("4", "4", "Finished");
INSERT INTO "constructorResults" VALUES ("5", "5", "Finished");
INSERT INTO "constructorResults" VALUES ("6", "6", "Finished");
INSERT INTO "constructorResults" VALUES ("7", "7", "Finished");
INSERT INTO "constructorResults" VALUES ("8", "8", "Finished");
INSERT INTO "constructorResults" VALUES ("9", "9", "Finished");
INSERT INTO "constructorResults" VALUES ("10", "10", "Finished");
INSERT INTO "constructorResults" VALUES ("11", "1", "Retired");
INSERT INTO "constructorResults" VALUES ("12", "2", "Disqualified");