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

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

CREATE TABLE "qualifying" (
"qualifyId" INT,
"position" INT,
PRIMARY KEY ("qualifyId")
);

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



INSERT INTO "driverStandings" VALUES ("1", "5");
INSERT INTO "driverStandings" VALUES ("2", "3");
INSERT INTO "driverStandings" VALUES ("3", "7");
INSERT INTO "driverStandings" VALUES ("4", "2");
INSERT INTO "driverStandings" VALUES ("5", "0");
INSERT INTO "drivers" VALUES ("1", "VER", "1997-09-30", "Dutch");
INSERT INTO "drivers" VALUES ("2", "LEC", "1999-10-03", "Monegasque");
INSERT INTO "drivers" VALUES ("3", "SAI", "1996-02-01", "Spanish");
INSERT INTO "drivers" VALUES ("4", "RUS", "1999-09-06", "Russian");
INSERT INTO "drivers" VALUES ("5", "OCO", "1996-09-27", "French");
INSERT INTO "qualifying" VALUES ("1", "1");
INSERT INTO "qualifying" VALUES ("2", "2");
INSERT INTO "qualifying" VALUES ("3", "3");
INSERT INTO "qualifying" VALUES ("4", "4");
INSERT INTO "qualifying" VALUES ("5", "5");
INSERT INTO "results" VALUES ("1", "33");
INSERT INTO "results" VALUES ("2", "16");
INSERT INTO "results" VALUES ("3", "55");
INSERT INTO "results" VALUES ("4", "63");
INSERT INTO "results" VALUES ("5", "31");