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 "constructors" (
"constructorId" INT,
"name" TEXT,
PRIMARY KEY ("constructorId")
);

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

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



INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Red Bull");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
INSERT INTO "drivers" VALUES ("101", "Nico", "Hulkenberg", "1987-08-19", "German");
INSERT INTO "drivers" VALUES ("102", "Sebastian", "Vettel", "1987-07-03", "German");
INSERT INTO "drivers" VALUES ("103", "Mark", "Webber", "1976-08-27", "Australian");
INSERT INTO "drivers" VALUES ("104", "Jochen", "Rindt", "1942-04-18", "Austrian");
INSERT INTO "drivers" VALUES ("105", "Niki", "Lauda", "1949-02-22", "Austrian");
INSERT INTO "drivers" VALUES ("106", "Gerhard", "Berger", "1959-08-27", "Austrian");
INSERT INTO "drivers" VALUES ("107", "Alexander", "Wurz", "1974-02-15", "Austrian");
INSERT INTO "drivers" VALUES ("108", "Christian", "Klien", "1983-02-07", "Austrian");
INSERT INTO "drivers" VALUES ("109", "Patrick", "Frey", "1981-01-01", "Austrian");
INSERT INTO "drivers" VALUES ("110", "Stefan", "Johannson", "1991-12-31", "Austrian");
INSERT INTO "drivers" VALUES ("111", "Stefan", "Johansson", "1990-05-15", "Austrian");
INSERT INTO "drivers" VALUES ("112", "Stefan", "Johannsen", "1985-11-20", "Austrian");
INSERT INTO "drivers" VALUES ("113", "Stefan", "Johannsson", "1988-07-07", "Austrian");
INSERT INTO "drivers" VALUES ("114", "Max", "Müller", "1989-03-12", "Austrian");
INSERT INTO "drivers" VALUES ("115", "Maximilian", "Müller", "1982-06-30", "Austrian");
INSERT INTO "drivers" VALUES ("116", "Max", "Mueller", "1984-09-25", "Austrian");
INSERT INTO "drivers" VALUES ("117", "Max", "Muller", "1986-12-05", "Austrian");
INSERT INTO "drivers" VALUES ("118", "Max", "Müller", "1979-04-10", "Austrian");
INSERT INTO "drivers" VALUES ("119", "Max", "Müller", "1992-01-01", "Austrian");
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");