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 "drivers" (
"driverId" INT,
"driverRef" TEXT,
"forename" TEXT,
"surname" TEXT,
PRIMARY KEY ("driverId")
);

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

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



INSERT INTO "drivers" VALUES ("1", "rkubica", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("2", "rkubica2", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("3", "r_kub", "Rob", "Kubica");
INSERT INTO "drivers" VALUES ("4", "kubro", "Robert", "Kub");
INSERT INTO "drivers" VALUES ("5", "NULL", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("6", "rkub", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("7", "rkubica", "Roberto", "Kubica");
INSERT INTO "drivers" VALUES ("8", "kubica_r", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("9", "Kubica", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("10", "rkubica1", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("11", "rkubicaX", "Robert", "Kubica");
INSERT INTO "drivers" VALUES ("12", "rkubica", "Rob", "Kub");