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", "Charles", "Leclerc", "Monegasque");
INSERT INTO "drivers" VALUES ("5", "Lando", "Norris", "British");
INSERT INTO "drivers" VALUES ("6", "Valtteri", "Bottas", "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", "1", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("5", "105", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("6", "101", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("7", "102", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("8", "103", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("9", "104", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("10", "105", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("11", "101", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("12", "102", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("13", "103", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("14", "104", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("15", "105", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("16", "101", "4", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("17", "102", "4", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("18", "103", "4", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("19", "104", "4", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("20", "105", "4", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("21", "101", "5", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("22", "102", "5", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("23", "103", "5", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("24", "104", "5", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("25", "105", "5", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("26", "101", "6", "8.0", "0");
INSERT INTO "driverStandings" VALUES ("27", "102", "6", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("28", "103", "6", "8.0", "0");
INSERT INTO "driverStandings" VALUES ("29", "104", "6", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("30", "105", "6", "8.0", "0");
INSERT INTO "results" VALUES ("1", "1", "1", "1");
INSERT INTO "results" VALUES ("2", "2", "2", "1");
INSERT INTO "results" VALUES ("3", "3", "3", "1");
INSERT INTO "results" VALUES ("4", "4", "4", "1");
INSERT INTO "results" VALUES ("5", "5", "5", "1");
INSERT INTO "results" VALUES ("6", "6", "6", "1");