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 "circuits" (
"circuitId" INT,
"name" TEXT,
"country" TEXT,
PRIMARY KEY ("circuitId")
);

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



INSERT INTO "circuits" VALUES ("1", "Marina Bay Street Circuit", "Singapore");
INSERT INTO "circuits" VALUES ("2", "Silverstone Circuit", "United Kingdom");
INSERT INTO "circuits" VALUES ("3", "Monza Circuit", "Italy");
INSERT INTO "circuits" VALUES ("4", "Suzuka Circuit", "Japan");
INSERT INTO "races" VALUES ("101", "2008", "Singapore Grand Prix", "2008-09-28");
INSERT INTO "races" VALUES ("102", "2009", "Singapore Grand Prix", "2009-09-27");
INSERT INTO "races" VALUES ("103", "2010", "Singapore Grand Prix", "2010-09-26");
INSERT INTO "races" VALUES ("104", "2008", "British Grand Prix", "2008-07-06");
INSERT INTO "races" VALUES ("105", "2007", "Italian Grand Prix", "2007-09-09");
INSERT INTO "races" VALUES ("106", "2006", "Japanese Grand Prix", "2006-10-08");
INSERT INTO "races" VALUES ("107", "2005", "Singapore Grand Prix", "2005-09-25");
INSERT INTO "races" VALUES ("108", "2011", "Singapore Grand Prix", "2011-09-25");