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", "Monza Circuit", "Italy");
INSERT INTO "circuits" VALUES ("3", "Silverstone Circuit", "United Kingdom");
INSERT INTO "circuits" VALUES ("4", "Circuit de Monaco", "Monaco");
INSERT INTO "circuits" VALUES ("5", "Suzuka Circuit", "Japan");
INSERT INTO "circuits" VALUES ("6", "Circuit Gilles Villeneuve", "Canada");
INSERT INTO "circuits" VALUES ("7", "Circuit of the Americas", "USA");
INSERT INTO "circuits" VALUES ("8", "Albert Park Circuit", "Australia");
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", "2011", "Singapore Grand Prix", "2011-09-25");
INSERT INTO "races" VALUES ("105", "2012", "Singapore Grand Prix", "2012-09-23");
INSERT INTO "races" VALUES ("106", "2013", "Singapore Grand Prix", "2013-09-22");
INSERT INTO "races" VALUES ("107", "2014", "Singapore Grand Prix", "2014-09-21");
INSERT INTO "races" VALUES ("108", "2015", "Singapore Grand Prix", "2015-09-20");
INSERT INTO "races" VALUES ("109", "2016", "Singapore Grand Prix", "2016-09-18");
INSERT INTO "races" VALUES ("110", "2017", "Singapore Grand Prix", "2017-09-17");
INSERT INTO "races" VALUES ("201", "2008", "Italian Grand Prix", "2008-09-14");
INSERT INTO "races" VALUES ("202", "2008", "British Grand Prix", "2008-07-06");
INSERT INTO "races" VALUES ("203", "2008", "Monaco Grand Prix", "2008-05-25");
INSERT INTO "races" VALUES ("204", "2008", "Japanese Grand Prix", "2008-10-12");
INSERT INTO "races" VALUES ("205", "2008", "Canadian Grand Prix", "2008-06-08");
INSERT INTO "races" VALUES ("206", "2008", "United States Grand Prix", "2008-06-22");
INSERT INTO "races" VALUES ("207", "2008", "Australian Grand Prix", "2008-03-16");
INSERT INTO "races" VALUES ("301", "2010", "Monaco Grand Prix", "2010-05-16");
INSERT INTO "races" VALUES ("302", "2010", "Italian Grand Prix", "2010-09-12");
INSERT INTO "races" VALUES ("303", "2010", "British Grand Prix", "2010-07-11");
INSERT INTO "races" VALUES ("304", "2010", "Japanese Grand Prix", "2010-10-10");
INSERT INTO "races" VALUES ("305", "2010", "Canadian Grand Prix", "2010-06-13");
INSERT INTO "races" VALUES ("306", "2010", "United States Grand Prix", "2010-06-27");
INSERT INTO "races" VALUES ("307", "2010", "Australian Grand Prix", "2010-03-28");
INSERT INTO "races" VALUES ("401", "2014", "Singapore Grand Prix", "2014-09-21");
INSERT INTO "races" VALUES ("402", "2014", "Singapore Night Race", "2014-09-22");
INSERT INTO "races" VALUES ("403", "2014", "Italian Grand Prix", "2014-09-07");
INSERT INTO "races" VALUES ("404", "2014", "British Grand Prix", "2014-07-06");
INSERT INTO "races" VALUES ("501", "2015", "Singapore Grand Prix", "2015-09-20");
INSERT INTO "races" VALUES ("502", "2015", "Singapore Night Race", "2015-09-21");
INSERT INTO "races" VALUES ("503", "2015", "Italian Grand Prix", "2015-09-06");
INSERT INTO "races" VALUES ("504", "2015", "British Grand Prix", "2015-07-05");