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,
"position" INT,
PRIMARY KEY ("driverStandingsId")
);

CREATE TABLE "constructors" (
"constructorId" INT,
"name" TEXT,
PRIMARY KEY ("constructorId")
);

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

CREATE TABLE "races" (
"raceId" INT,
"name" TEXT,
PRIMARY KEY ("raceId")
);

CREATE TABLE "results" (
"resultId" INT,
"raceId" INT,
"driverId" INT,
"points" FLOAT,
PRIMARY KEY ("resultId"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId"),
FOREIGN KEY ("driverId") REFERENCES "drivers"("driverId")
);



INSERT INTO "driverStandings" VALUES ("1", "1");
INSERT INTO "driverStandings" VALUES ("2", "2");
INSERT INTO "driverStandings" VALUES ("3", "3");
INSERT INTO "driverStandings" VALUES ("4", "4");
INSERT INTO "driverStandings" VALUES ("5", "5");
INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
INSERT INTO "constructors" VALUES ("4", "McLaren");
INSERT INTO "constructors" VALUES ("5", "Aston Martin");
INSERT INTO "drivers" VALUES ("1", "Lewis", "Hamilton");
INSERT INTO "drivers" VALUES ("2", "Max", "Verstappen");
INSERT INTO "drivers" VALUES ("3", "Charles", "Leclerc");
INSERT INTO "drivers" VALUES ("4", "Fernando", "Alonso");
INSERT INTO "drivers" VALUES ("5", "Sergio", "Perez");
INSERT INTO "drivers" VALUES ("6", "George", "Russell");
INSERT INTO "drivers" VALUES ("7", "Carlos", "Sainz");
INSERT INTO "races" VALUES ("1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("2", "Saudi Arabian Grand Prix");
INSERT INTO "races" VALUES ("3", "Australian Grand Prix");
INSERT INTO "races" VALUES ("4", "Azerbaijan Grand Prix");
INSERT INTO "races" VALUES ("5", "Miami Grand Prix");
INSERT INTO "races" VALUES ("6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("7", "Spanish Grand Prix");
INSERT INTO "results" VALUES ("1", "1", "1", "18.0");
INSERT INTO "results" VALUES ("2", "1", "2", "25.0");
INSERT INTO "results" VALUES ("3", "1", "3", "15.0");
INSERT INTO "results" VALUES ("4", "2", "1", "12.0");
INSERT INTO "results" VALUES ("5", "2", "2", "18.0");
INSERT INTO "results" VALUES ("6", "2", "5", "25.0");
INSERT INTO "results" VALUES ("7", "3", "1", "10.0");
INSERT INTO "results" VALUES ("8", "3", "2", "12.0");
INSERT INTO "results" VALUES ("9", "3", "4", "15.0");
INSERT INTO "results" VALUES ("10", "4", "1", "6.0");
INSERT INTO "results" VALUES ("11", "4", "2", "25.0");
INSERT INTO "results" VALUES ("12", "4", "5", "18.0");
INSERT INTO "results" VALUES ("13", "5", "1", "8.0");
INSERT INTO "results" VALUES ("14", "5", "2", "25.0");
INSERT INTO "results" VALUES ("15", "5", "3", "10.0");
INSERT INTO "results" VALUES ("16", "6", "1", "0.0");
INSERT INTO "results" VALUES ("17", "6", "2", "25.0");
INSERT INTO "results" VALUES ("18", "6", "4", "18.0");
INSERT INTO "results" VALUES ("19", "7", "1", "15.0");
INSERT INTO "results" VALUES ("20", "7", "2", "25.0");
INSERT INTO "results" VALUES ("21", "7", "6", "12.0");