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

CREATE TABLE "lapTimes" (
"raceId" INT,
"driverId" INT,
"lap" INT,
"milliseconds" INT,
PRIMARY KEY ("raceId", "driverId", "lap")
);

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

CREATE TABLE "results" (
"resultId" INT,
"position" INT,
PRIMARY KEY ("resultId")
);



INSERT INTO "drivers" VALUES ("1", "1950-01-15", "United Kingdom");
INSERT INTO "drivers" VALUES ("2", "1950-01-15", "Italy");
INSERT INTO "drivers" VALUES ("3", "1951-06-30", "Germany");
INSERT INTO "drivers" VALUES ("4", "1960-12-01", "Brazil");
INSERT INTO "drivers" VALUES ("5", "1975-07-20", "France");
INSERT INTO "drivers" VALUES ("6", "1980-03-10", "Spain");
INSERT INTO "drivers" VALUES ("7", "1985-11-25", "Australia");
INSERT INTO "drivers" VALUES ("8", "1990-05-05", "Japan");
INSERT INTO "drivers" VALUES ("9", "1995-08-15", "Canada");
INSERT INTO "drivers" VALUES ("10", "2000-09-09", "United States");
INSERT INTO "drivers" VALUES ("11", "1950-01-14", "Netherlands");
INSERT INTO "drivers" VALUES ("12", "1950-01-16", "Sweden");
INSERT INTO "driverStandings" VALUES ("1", "150.5");
INSERT INTO "driverStandings" VALUES ("2", "120.0");
INSERT INTO "driverStandings" VALUES ("3", "98.0");
INSERT INTO "driverStandings" VALUES ("4", "75.5");
INSERT INTO "driverStandings" VALUES ("5", "60.0");
INSERT INTO "driverStandings" VALUES ("6", "45.0");
INSERT INTO "driverStandings" VALUES ("7", "30.0");
INSERT INTO "driverStandings" VALUES ("8", "20.0");
INSERT INTO "driverStandings" VALUES ("9", "10.0");
INSERT INTO "driverStandings" VALUES ("10", "5.0");
INSERT INTO "driverStandings" VALUES ("11", "140.0");
INSERT INTO "driverStandings" VALUES ("12", "130.0");
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");
INSERT INTO "results" VALUES ("6", "6");
INSERT INTO "results" VALUES ("7", "7");
INSERT INTO "results" VALUES ("8", "8");
INSERT INTO "results" VALUES ("9", "9");
INSERT INTO "results" VALUES ("10", "10");
INSERT INTO "results" VALUES ("11", "11");
INSERT INTO "results" VALUES ("12", "12");
INSERT INTO "lapTimes" VALUES ("101", "1", "1", "90000");
INSERT INTO "lapTimes" VALUES ("101", "1", "2", "89500");
INSERT INTO "lapTimes" VALUES ("101", "2", "1", "90200");
INSERT INTO "lapTimes" VALUES ("101", "2", "2", "89000");
INSERT INTO "lapTimes" VALUES ("102", "3", "1", "88000");
INSERT INTO "lapTimes" VALUES ("102", "3", "2", "87500");
INSERT INTO "lapTimes" VALUES ("102", "4", "1", "87000");
INSERT INTO "lapTimes" VALUES ("102", "4", "2", "86500");
INSERT INTO "lapTimes" VALUES ("103", "5", "1", "86000");
INSERT INTO "lapTimes" VALUES ("103", "5", "2", "85500");
INSERT INTO "lapTimes" VALUES ("103", "6", "1", "85000");
INSERT INTO "lapTimes" VALUES ("103", "6", "2", "84500");