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,
"forename" TEXT,
"surname" TEXT,
"dob" DATE,
"nationality" TEXT,
"url" TEXT,
PRIMARY KEY ("driverId")
);

CREATE TABLE "races" (
"raceId" INT,
"name" TEXT,
PRIMARY KEY ("raceId")
);

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



INSERT INTO "constructors" VALUES ("1", "Mercedes");
INSERT INTO "constructors" VALUES ("2", "Ferrari");
INSERT INTO "constructors" VALUES ("3", "Red Bull");
INSERT INTO "constructors" VALUES ("4", "McLaren");
INSERT INTO "constructors" VALUES ("5", "Aston Martin");
INSERT INTO "drivers" VALUES ("1", "Michael", "Schumacher", "1969-01-03", "German", "http://en.wikipedia.org/wiki/Michael_Schumacher");
INSERT INTO "drivers" VALUES ("2", "Sebastian", "Vettel", "1987-07-03", "German", "http://en.wikipedia.org/wiki/Sebastian_Vettel");
INSERT INTO "drivers" VALUES ("3", "Nico", "Rosberg", "1985-06-27", "German", "http://en.wikipedia.org/wiki/Nico_Rosberg");
INSERT INTO "drivers" VALUES ("4", "Lewis", "Hamilton", "1985-01-07", "British", "http://en.wikipedia.org/wiki/Lewis_Hamilton");
INSERT INTO "drivers" VALUES ("5", "Fernando", "Alonso", "1981-07-29", "Spanish", "http://en.wikipedia.org/wiki/Fernando_Alonso");
INSERT INTO "drivers" VALUES ("6", "Ralf", "Schumacher", "1975-06-30", "German", "http://en.wikipedia.org/wiki/Ralf_Schumacher");
INSERT INTO "drivers" VALUES ("7", "Nick", "Heidfeld", "1977-05-10", "German", "http://en.wikipedia.org/wiki/Nick_Heidfeld");
INSERT INTO "drivers" VALUES ("8", "Adrian", "Sutil", "1983-01-11", "German", "http://en.wikipedia.org/wiki/Adrian_Sutil");
INSERT INTO "drivers" VALUES ("9", "Timo", "Glock", "1982-03-18", "German", "http://en.wikipedia.org/wiki/Timo_Glock");
INSERT INTO "drivers" VALUES ("10", "Nico", "Hulkenberg", "1987-08-19", "German", "http://en.wikipedia.org/wiki/Nico_H%C3%BClkenberg");
INSERT INTO "drivers" VALUES ("11", "Jenson", "Button", "1980-01-19", "British", "http://en.wikipedia.org/wiki/Jenson_Button");
INSERT INTO "drivers" VALUES ("12", "Kimi", "Raikkonen", "1979-10-17", "Finnish", "http://en.wikipedia.org/wiki/Kimi_R%C3%A4ikk%C3%B6nen");
INSERT INTO "drivers" VALUES ("13", "Mark", "Webber", "1976-08-27", "Australian", "http://en.wikipedia.org/wiki/Mark_Webber");
INSERT INTO "drivers" VALUES ("14", "Rubens", "Barrichello", "1972-05-23", "Brazilian", "http://en.wikipedia.org/wiki/Rubens_Barrichello");
INSERT INTO "drivers" VALUES ("15", "David", "Coulthard", "1971-03-27", "British", "http://en.wikipedia.org/wiki/David_Coulthard");
INSERT INTO "drivers" VALUES ("16", "Heinz-Harald", "Frentzen", "1967-05-18", "German", "http://en.wikipedia.org/wiki/Heinz-Harald_Frentzen");
INSERT INTO "races" VALUES ("1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("3", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("4", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("5", "Spanish Grand Prix");
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");