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

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

CREATE TABLE "drivers" (
"driverId" INT UNIQUE,
"dob" DATE,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

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



INSERT INTO "drivers" VALUES ("1", "1985-01-01", "British");
INSERT INTO "drivers" VALUES ("2", "1990-05-15", "German");
INSERT INTO "drivers" VALUES ("3", "1978-11-22", "Spanish");
INSERT INTO "drivers" VALUES ("4", "1995-03-10", "Dutch");
INSERT INTO "drivers" VALUES ("5", "1980-07-04", "Finnish");
INSERT INTO "drivers" VALUES ("6", "1975-02-28", "Brazilian");
INSERT INTO "drivers" VALUES ("7", "1988-09-01", "French");
INSERT INTO "drivers" VALUES ("8", "1992-12-25", "Mexican");
INSERT INTO "drivers" VALUES ("9", "1970-06-18", "Italian");
INSERT INTO "drivers" VALUES ("10", "1983-04-03", "Australian");
INSERT INTO "constructors" VALUES ("1", "British");
INSERT INTO "constructors" VALUES ("2", "German");
INSERT INTO "constructors" VALUES ("3", "Italian");
INSERT INTO "constructors" VALUES ("4", "Austrian");
INSERT INTO "constructors" VALUES ("5", "French");
INSERT INTO "driverStandings" VALUES ("101", "1");
INSERT INTO "driverStandings" VALUES ("102", "2");
INSERT INTO "driverStandings" VALUES ("103", "3");
INSERT INTO "driverStandings" VALUES ("104", "4");
INSERT INTO "driverStandings" VALUES ("105", "5");
INSERT INTO "driverStandings" VALUES ("106", "6");
INSERT INTO "driverStandings" VALUES ("107", "7");
INSERT INTO "driverStandings" VALUES ("108", "8");
INSERT INTO "driverStandings" VALUES ("109", "9");
INSERT INTO "driverStandings" VALUES ("110", "10");
INSERT INTO "races" VALUES ("1", "Grand Prix 2023");
INSERT INTO "races" VALUES ("2", "Monaco GP");
INSERT INTO "races" VALUES ("3", "Silverstone GP");
INSERT INTO "races" VALUES ("4", "Spa-Francorchamps GP");
INSERT INTO "races" VALUES ("5", "Suzuka GP");