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,
"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", "0");
INSERT INTO "driverStandings" VALUES ("3", "3");
INSERT INTO "driverStandings" VALUES ("4", "1");
INSERT INTO "driverStandings" VALUES ("5", "7");
INSERT INTO "drivers" VALUES ("1", "HAM", "British");
INSERT INTO "drivers" VALUES ("2", "VER", "Dutch");
INSERT INTO "drivers" VALUES ("3", "LEC", "Monegasque");
INSERT INTO "drivers" VALUES ("4", "SAI", "Italian");
INSERT INTO "drivers" VALUES ("5", "RIC", "Australian");
INSERT INTO "drivers" VALUES ("6", "GAS", "French");
INSERT INTO "drivers" VALUES ("7", "ALO", "Spanish");
INSERT INTO "drivers" VALUES ("8", "RUS", "Russian");
INSERT INTO "drivers" VALUES ("9", "TSU", "Japanese");
INSERT INTO "drivers" VALUES ("10", "LAT", "Latvian");
INSERT INTO "drivers" VALUES ("11", "OCO", "French");
INSERT INTO "drivers" VALUES ("12", "NOR", "Norwegian");
INSERT INTO "drivers" VALUES ("13", "MSC", "German");
INSERT INTO "drivers" VALUES ("14", "VET", "German");
INSERT INTO "drivers" VALUES ("15", "GIO", "Italian");
INSERT INTO "drivers" VALUES ("16", "MAG", "Swiss");
INSERT INTO "drivers" VALUES ("17", "RUS2", "American");
INSERT INTO "drivers" VALUES ("18", "USA1", "America");
INSERT INTO "drivers" VALUES ("19", "USA2", "America");
INSERT INTO "drivers" VALUES ("20", "CAN", "Canadian");
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 "qualifying" VALUES ("6", "6");
INSERT INTO "qualifying" VALUES ("7", "7");
INSERT INTO "qualifying" VALUES ("8", "8");
INSERT INTO "qualifying" VALUES ("9", "9");
INSERT INTO "qualifying" VALUES ("10", "10");
INSERT INTO "results" VALUES ("1", "44");
INSERT INTO "results" VALUES ("2", "33");
INSERT INTO "results" VALUES ("3", "16");
INSERT INTO "results" VALUES ("4", "55");
INSERT INTO "results" VALUES ("5", "3");
INSERT INTO "results" VALUES ("6", "14");
INSERT INTO "results" VALUES ("7", "31");
INSERT INTO "results" VALUES ("8", "18");
INSERT INTO "results" VALUES ("9", "22");
INSERT INTO "results" VALUES ("10", "6");