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 "driverStandings" VALUES ("1", "101", "1", "150.5", "3");
INSERT INTO "driverStandings" VALUES ("2", "101", "2", "160.0", "4");
INSERT INTO "driverStandings" VALUES ("3", "101", "3", "120.0", "2");
INSERT INTO "driverStandings" VALUES ("4", "101", "4", "110.0", "1");
INSERT INTO "driverStandings" VALUES ("5", "101", "5", "90.0", "0");
INSERT INTO "driverStandings" VALUES ("6", "102", "1", "180.5", "4");
INSERT INTO "driverStandings" VALUES ("7", "102", "2", "170.0", "5");
INSERT INTO "driverStandings" VALUES ("8", "102", "3", "130.0", "3");
INSERT INTO "driverStandings" VALUES ("9", "102", "4", "115.0", "1");
INSERT INTO "driverStandings" VALUES ("10", "102", "5", "95.0", "0");
INSERT INTO "driverStandings" VALUES ("11", "103", "1", "200.5", "5");
INSERT INTO "driverStandings" VALUES ("12", "103", "2", "210.0", "6");
INSERT INTO "driverStandings" VALUES ("13", "103", "3", "140.0", "3");
INSERT INTO "driverStandings" VALUES ("14", "103", "4", "120.0", "2");
INSERT INTO "driverStandings" VALUES ("15", "103", "5", "100.0", "1");
INSERT INTO "results" VALUES ("1", "1");
INSERT INTO "results" VALUES ("2", "2");
INSERT INTO "results" VALUES ("3", "3");
INSERT INTO "results" VALUES ("4", "4");
INSERT INTO "results" VALUES ("5", "5");