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

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

CREATE TABLE "results" (
"resultId" INT,
"raceId" INT,
"constructorId" INT,
"position" INT,
"points" FLOAT,
PRIMARY KEY ("resultId"),
FOREIGN KEY ("constructorId") REFERENCES "constructors"("constructorId")
);



INSERT INTO "constructorStandings" VALUES ("1", "25.0");
INSERT INTO "constructorStandings" VALUES ("2", "18.5");
INSERT INTO "constructorStandings" VALUES ("3", "1.0");
INSERT INTO "constructorStandings" VALUES ("4", "0.0");
INSERT INTO "constructors" VALUES ("101", "Speedster Racing", "Italy");
INSERT INTO "constructors" VALUES ("102", "Falcon Motors", "Germany");
INSERT INTO "constructors" VALUES ("103", "Blue Wave", "Japan");
INSERT INTO "constructors" VALUES ("104", "Redline Autos", "Brazil");
INSERT INTO "results" VALUES ("201", "24", "101", "3", "15.0");
INSERT INTO "results" VALUES ("202", "24", "102", "5", "10.0");
INSERT INTO "results" VALUES ("203", "24", "103", "10", "1.0");
INSERT INTO "results" VALUES ("204", "24", "104", "15", "0.0");
INSERT INTO "results" VALUES ("205", "25", "101", "1", "25.0");
INSERT INTO "results" VALUES ("206", "25", "102", "2", "18.5");
INSERT INTO "results" VALUES ("207", "25", "103", "20", "0.0");