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,
"raceId" INT,
"driverId" INT,
"points" FLOAT,
"wins" INT,
PRIMARY KEY ("driverStandingsId"),
FOREIGN KEY ("driverId") REFERENCES "drivers"("driverId")
);

CREATE TABLE "drivers" (
"driverId" INT UNIQUE,
"forename" TEXT,
"surname" TEXT,
"dob" DATE,
PRIMARY KEY ("driverId")
);

CREATE TABLE "results" (
"resultId" INT,
"position" INT,
PRIMARY KEY ("resultId")
);



INSERT INTO "drivers" VALUES ("1", "Lewis", "Hamilton", "1985-01-07");
INSERT INTO "drivers" VALUES ("2", "Sebastian", "Vettel", "1987-07-03");
INSERT INTO "drivers" VALUES ("3", "Kimi", "Raikkonen", "1979-10-17");
INSERT INTO "drivers" VALUES ("4", "Max", "Verstappen", "1997-09-30");
INSERT INTO "drivers" VALUES ("5", "Fernando", "Alonso", "1981-07-29");
INSERT INTO "driverStandings" VALUES ("101", "201", "1", "347.0", "11");
INSERT INTO "driverStandings" VALUES ("102", "201", "2", "320.0", "9");
INSERT INTO "driverStandings" VALUES ("103", "201", "3", "210.0", "4");
INSERT INTO "driverStandings" VALUES ("104", "201", "4", "280.0", "7");
INSERT INTO "driverStandings" VALUES ("105", "201", "5", "150.0", "3");
INSERT INTO "results" VALUES ("1001", "1");
INSERT INTO "results" VALUES ("1002", "2");
INSERT INTO "results" VALUES ("1003", "3");
INSERT INTO "results" VALUES ("1004", "4");
INSERT INTO "results" VALUES ("1005", "5");