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,
"driverId" INT,
"points" FLOAT,
"position" INT,
PRIMARY KEY ("driverStandingsId"),
FOREIGN KEY ("driverId") REFERENCES "drivers"("driverId")
);

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")
);



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", "Sergio", "Perez");
INSERT INTO "drivers" VALUES ("5", "George", "Russell");
INSERT INTO "drivers" VALUES ("6", "Carlos", "Sainz");
INSERT INTO "drivers" VALUES ("7", "Lando", "Norris");
INSERT INTO "drivers" VALUES ("8", "Fernando", "Alonso");
INSERT INTO "drivers" VALUES ("9", "Valtteri", "Bottas");
INSERT INTO "drivers" VALUES ("10", "Daniel", "Ricciardo");
INSERT INTO "driverStandings" VALUES ("1", "1", "400.5", "1");
INSERT INTO "driverStandings" VALUES ("2", "2", "399.0", "2");
INSERT INTO "driverStandings" VALUES ("3", "3", "350.0", "3");
INSERT INTO "driverStandings" VALUES ("4", "4", "300.0", "4");
INSERT INTO "driverStandings" VALUES ("5", "5", "250.0", "5");
INSERT INTO "driverStandings" VALUES ("6", "6", "245.0", "6");
INSERT INTO "driverStandings" VALUES ("7", "7", "180.0", "7");
INSERT INTO "driverStandings" VALUES ("8", "8", "150.0", "8");
INSERT INTO "driverStandings" VALUES ("9", "9", "100.0", "9");
INSERT INTO "driverStandings" VALUES ("10", "10", "80.0", "10");
INSERT INTO "driverStandings" VALUES ("11", "1", "400.5", "1");
INSERT INTO "driverStandings" VALUES ("12", "2", "399.0", "2");
INSERT INTO "driverStandings" VALUES ("13", "3", "350.0", "3");
INSERT INTO "driverStandings" VALUES ("14", "4", "300.0", "4");
INSERT INTO "driverStandings" VALUES ("15", "5", "250.0", "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", "Alpine");
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", "Emilia Romagna Grand Prix");
INSERT INTO "races" VALUES ("5", "Miami Grand Prix");