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 "driverStandings" (
"driverStandingsId" INT,
"position" INT,
PRIMARY KEY ("driverStandingsId")
);

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

CREATE TABLE "drivers" (
"driverId" INT UNIQUE,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

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



INSERT INTO "driverStandings" VALUES ("1", "1");
INSERT INTO "driverStandings" VALUES ("2", "2");
INSERT INTO "driverStandings" VALUES ("3", "3");
INSERT INTO "driverStandings" VALUES ("4", "4");
INSERT INTO "driverStandings" VALUES ("5", "5");
INSERT INTO "driverStandings" VALUES ("6", "6");
INSERT INTO "driverStandings" VALUES ("7", "7");
INSERT INTO "driverStandings" VALUES ("8", "8");
INSERT INTO "driverStandings" VALUES ("9", "9");
INSERT INTO "driverStandings" VALUES ("10", "10");
INSERT INTO "constructors" VALUES ("1", "British");
INSERT INTO "constructors" VALUES ("2", "German");
INSERT INTO "constructors" VALUES ("3", "Italian");
INSERT INTO "constructors" VALUES ("4", "French");
INSERT INTO "drivers" VALUES ("101", "British");
INSERT INTO "drivers" VALUES ("102", "British");
INSERT INTO "drivers" VALUES ("103", "British");
INSERT INTO "drivers" VALUES ("104", "British");
INSERT INTO "drivers" VALUES ("105", "British");
INSERT INTO "drivers" VALUES ("106", "German");
INSERT INTO "drivers" VALUES ("107", "German");
INSERT INTO "drivers" VALUES ("108", "Italian");
INSERT INTO "drivers" VALUES ("109", "French");
INSERT INTO "drivers" VALUES ("110", "Spanish");
INSERT INTO "results" VALUES ("201", "1");
INSERT INTO "results" VALUES ("202", "2");
INSERT INTO "results" VALUES ("203", "3");
INSERT INTO "results" VALUES ("204", "4");
INSERT INTO "results" VALUES ("205", "1");
INSERT INTO "results" VALUES ("206", "2");
INSERT INTO "results" VALUES ("207", "3");
INSERT INTO "results" VALUES ("208", "4");
INSERT INTO "results" VALUES ("209", "1");
INSERT INTO "results" VALUES ("210", "2");