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,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

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



INSERT INTO "drivers" VALUES ("1", "Lewis", "Hamilton", "British");
INSERT INTO "drivers" VALUES ("2", "Max", "Verstappen", "Dutch");
INSERT INTO "drivers" VALUES ("3", "Sebastian", "Vettel", "German");
INSERT INTO "drivers" VALUES ("4", "Fernando", "Alonso", "Spanish");
INSERT INTO "drivers" VALUES ("5", "Kimi", "Raikkonen", "Finnish");
INSERT INTO "driverStandings" VALUES ("1", "101", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("2", "102", "1", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("3", "103", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("4", "104", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("5", "105", "2", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("6", "106", "3", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("7", "107", "3", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("8", "108", "4", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("9", "109", "5", "8.0", "0");
INSERT INTO "driverStandings" VALUES ("10", "110", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("11", "111", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("12", "112", "1", "18.0", "0");
INSERT INTO "results" VALUES ("201", "1", "1", "1");
INSERT INTO "results" VALUES ("202", "2", "2", "1");
INSERT INTO "results" VALUES ("203", "3", "3", "1");
INSERT INTO "results" VALUES ("204", "4", "4", "1");
INSERT INTO "results" VALUES ("205", "5", "5", "1");
INSERT INTO "results" VALUES ("206", "6", "6", "2");
INSERT INTO "results" VALUES ("207", "7", "7", "3");
INSERT INTO "results" VALUES ("208", "8", "8", "1");
INSERT INTO "results" VALUES ("209", "9", "9", "1");
INSERT INTO "results" VALUES ("210", "10", "10", "1");