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,
"position" 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", "Daniel", "Ricciardo", "Australian");
INSERT INTO "driverStandings" VALUES ("1", "101", "1", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("2", "101", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("3", "101", "3", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("4", "101", "4", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("5", "101", "5", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("6", "101", "6", "8.0", "0");
INSERT INTO "driverStandings" VALUES ("7", "102", "1", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("8", "102", "2", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("9", "102", "3", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("10", "102", "4", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("11", "102", "5", "0.0", "0");
INSERT INTO "driverStandings" VALUES ("12", "102", "6", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("13", "103", "1", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("14", "103", "2", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("15", "103", "3", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("16", "103", "4", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("17", "103", "6", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("18", "104", "1", "12.0", "0");
INSERT INTO "driverStandings" VALUES ("19", "104", "2", "18.0", "0");
INSERT INTO "driverStandings" VALUES ("20", "104", "3", "10.0", "0");
INSERT INTO "driverStandings" VALUES ("21", "104", "4", "25.0", "1");
INSERT INTO "driverStandings" VALUES ("22", "104", "5", "15.0", "0");
INSERT INTO "driverStandings" VALUES ("23", "104", "6", "0.0", "0");