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", "Red Bull Racing");
INSERT INTO "constructors" VALUES ("2", "Mercedes");
INSERT INTO "constructors" VALUES ("3", "Ferrari");
INSERT INTO "drivers" VALUES ("101", "Nico", "Rosberg", "1985-06-27", "German");
INSERT INTO "drivers" VALUES ("102", "Sebastian", "Vettel", "1987-07-03", "German");
INSERT INTO "drivers" VALUES ("103", "Max", "Verstappen", "1997-09-30", "Dutch");
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", "Markus", "Winkelhock", "1980-09-13", "Austrian");
INSERT INTO "drivers" VALUES ("110", "Patrick", "Frey", "1988-11-20", "Austrian");
INSERT INTO "drivers" VALUES ("111", "Lucas", "Auer", "1994-10-11", "Austrian");
INSERT INTO "results" VALUES ("201", "1");
INSERT INTO "results" VALUES ("202", "2");
INSERT INTO "results" VALUES ("203", "3");
INSERT INTO "results" VALUES ("204", "4");
INSERT INTO "results" VALUES ("205", "5");