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 "races" (
"raceId" INT,
"year" INT,
"round" INT,
"name" TEXT,
PRIMARY KEY ("raceId"),
FOREIGN KEY ("year") REFERENCES "seasons"("year")
);

CREATE TABLE "results" (
"resultId" INT,
"raceId" INT,
PRIMARY KEY ("resultId"),
FOREIGN KEY ("raceId") REFERENCES "races"("raceId")
);

CREATE TABLE "seasons" (
"year" INT UNIQUE,
PRIMARY KEY ("year")
);



INSERT INTO "seasons" VALUES ("2000");
INSERT INTO "seasons" VALUES ("2001");
INSERT INTO "seasons" VALUES ("2002");
INSERT INTO "seasons" VALUES ("2003");
INSERT INTO "seasons" VALUES ("2004");
INSERT INTO "seasons" VALUES ("2005");
INSERT INTO "seasons" VALUES ("2006");
INSERT INTO "seasons" VALUES ("2007");
INSERT INTO "seasons" VALUES ("2008");
INSERT INTO "seasons" VALUES ("2009");
INSERT INTO "seasons" VALUES ("2010");
INSERT INTO "seasons" VALUES ("2011");
INSERT INTO "seasons" VALUES ("2012");
INSERT INTO "seasons" VALUES ("2013");
INSERT INTO "seasons" VALUES ("2014");
INSERT INTO "seasons" VALUES ("2015");
INSERT INTO "seasons" VALUES ("2016");
INSERT INTO "seasons" VALUES ("2017");
INSERT INTO "seasons" VALUES ("2018");
INSERT INTO "seasons" VALUES ("2019");
INSERT INTO "races" VALUES ("1", "2000", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("2", "2000", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("3", "2000", "3", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("4", "2000", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("5", "2000", "5", "British Grand Prix");
INSERT INTO "races" VALUES ("6", "2000", "6", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("7", "2000", "7", "European Grand Prix");
INSERT INTO "races" VALUES ("8", "2000", "8", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("9", "2000", "9", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("10", "2000", "10", "French Grand Prix");
INSERT INTO "races" VALUES ("11", "2000", "11", "Austrian Grand Prix");
INSERT INTO "races" VALUES ("12", "2000", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("13", "2000", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("14", "2000", "14", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("15", "2000", "15", "Italian Grand Prix");
INSERT INTO "races" VALUES ("16", "2000", "16", "United States Grand Prix");
INSERT INTO "races" VALUES ("17", "2000", "17", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("18", "2001", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("19", "2001", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("20", "2001", "3", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("21", "2001", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("22", "2001", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("23", "2001", "6", "Austrian Grand Prix");
INSERT INTO "races" VALUES ("24", "2001", "7", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("25", "2001", "8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("26", "2001", "9", "European Grand Prix");
INSERT INTO "races" VALUES ("27", "2001", "10", "French Grand Prix");
INSERT INTO "races" VALUES ("28", "2001", "11", "British Grand Prix");
INSERT INTO "races" VALUES ("29", "2001", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("30", "2001", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("31", "2001", "14", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("32", "2001", "15", "Italian Grand Prix");
INSERT INTO "races" VALUES ("33", "2001", "16", "United States Grand Prix");
INSERT INTO "races" VALUES ("34", "2001", "17", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("35", "2002", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("36", "2002", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("37", "2002", "3", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("38", "2002", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("39", "2002", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("40", "2002", "6", "Austrian Grand Prix");
INSERT INTO "races" VALUES ("41", "2002", "7", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("42", "2002", "8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("43", "2002", "9", "European Grand Prix");
INSERT INTO "races" VALUES ("44", "2002", "10", "British Grand Prix");
INSERT INTO "races" VALUES ("45", "2002", "11", "French Grand Prix");
INSERT INTO "races" VALUES ("46", "2002", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("47", "2002", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("48", "2002", "14", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("49", "2002", "15", "Italian Grand Prix");
INSERT INTO "races" VALUES ("50", "2002", "16", "United States Grand Prix");
INSERT INTO "races" VALUES ("51", "2002", "17", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("52", "2003", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("53", "2003", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("54", "2003", "3", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("55", "2003", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("56", "2003", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("57", "2003", "6", "Austrian Grand Prix");
INSERT INTO "races" VALUES ("58", "2003", "7", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("59", "2003", "8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("60", "2003", "9", "European Grand Prix");
INSERT INTO "races" VALUES ("61", "2003", "10", "French Grand Prix");
INSERT INTO "races" VALUES ("62", "2003", "11", "British Grand Prix");
INSERT INTO "races" VALUES ("63", "2003", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("64", "2003", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("65", "2003", "14", "Italian Grand Prix");
INSERT INTO "races" VALUES ("66", "2003", "15", "United States Grand Prix");
INSERT INTO "races" VALUES ("67", "2003", "16", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("68", "2004", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("69", "2004", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("70", "2004", "3", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("71", "2004", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("72", "2004", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("73", "2004", "6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("74", "2004", "7", "European Grand Prix");
INSERT INTO "races" VALUES ("75", "2004", "8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("76", "2004", "9", "United States Grand Prix");
INSERT INTO "races" VALUES ("77", "2004", "10", "French Grand Prix");
INSERT INTO "races" VALUES ("78", "2004", "11", "British Grand Prix");
INSERT INTO "races" VALUES ("79", "2004", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("80", "2004", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("81", "2004", "14", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("82", "2004", "15", "Italian Grand Prix");
INSERT INTO "races" VALUES ("83", "2004", "16", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("84", "2004", "17", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("85", "2004", "18", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("86", "2005", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("87", "2005", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("88", "2005", "3", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("89", "2005", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("90", "2005", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("91", "2005", "6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("92", "2005", "7", "European Grand Prix");
INSERT INTO "races" VALUES ("93", "2005", "8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("94", "2005", "9", "United States Grand Prix");
INSERT INTO "races" VALUES ("95", "2005", "10", "French Grand Prix");
INSERT INTO "races" VALUES ("96", "2005", "11", "British Grand Prix");
INSERT INTO "races" VALUES ("97", "2005", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("98", "2005", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("99", "2005", "14", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("100", "2005", "15", "Italian Grand Prix");
INSERT INTO "races" VALUES ("101", "2005", "16", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("102", "2005", "17", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("103", "2005", "18", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("104", "2005", "19", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("105", "2006", "1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("106", "2006", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("107", "2006", "3", "Australian Grand Prix");
INSERT INTO "races" VALUES ("108", "2006", "4", "San Marino Grand Prix");
INSERT INTO "races" VALUES ("109", "2006", "5", "European Grand Prix");
INSERT INTO "races" VALUES ("110", "2006", "6", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("111", "2006", "7", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("112", "2006", "8", "British Grand Prix");
INSERT INTO "races" VALUES ("113", "2006", "9", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("114", "2006", "10", "United States Grand Prix");
INSERT INTO "races" VALUES ("115", "2006", "11", "French Grand Prix");
INSERT INTO "races" VALUES ("116", "2006", "12", "German Grand Prix");
INSERT INTO "races" VALUES ("117", "2006", "13", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("118", "2006", "14", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("119", "2006", "15", "Italian Grand Prix");
INSERT INTO "races" VALUES ("120", "2006", "16", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("121", "2006", "17", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("122", "2006", "18", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("123", "2007", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("124", "2007", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("125", "2007", "3", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("126", "2007", "4", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("127", "2007", "5", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("128", "2007", "6", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("129", "2007", "7", "United States Grand Prix");
INSERT INTO "races" VALUES ("130", "2007", "8", "French Grand Prix");
INSERT INTO "races" VALUES ("131", "2007", "9", "British Grand Prix");
INSERT INTO "races" VALUES ("132", "2007", "10", "European Grand Prix");
INSERT INTO "races" VALUES ("133", "2007", "11", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("134", "2007", "12", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("135", "2007", "13", "Italian Grand Prix");
INSERT INTO "races" VALUES ("136", "2007", "14", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("137", "2007", "15", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("138", "2007", "16", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("139", "2007", "17", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("140", "2008", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("141", "2008", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("142", "2008", "3", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("143", "2008", "4", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("144", "2008", "5", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("145", "2008", "6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("146", "2008", "7", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("147", "2008", "8", "French Grand Prix");
INSERT INTO "races" VALUES ("148", "2008", "9", "British Grand Prix");
INSERT INTO "races" VALUES ("149", "2008", "10", "German Grand Prix");
INSERT INTO "races" VALUES ("150", "2008", "11", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("151", "2008", "12", "European Grand Prix");
INSERT INTO "races" VALUES ("152", "2008", "13", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("153", "2008", "14", "Italian Grand Prix");
INSERT INTO "races" VALUES ("154", "2008", "15", "Singapore Grand Prix");
INSERT INTO "races" VALUES ("155", "2008", "16", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("156", "2008", "17", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("157", "2008", "18", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("158", "2009", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("159", "2009", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("160", "2009", "3", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("161", "2009", "4", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("162", "2009", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("163", "2009", "6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("164", "2009", "7", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("165", "2009", "8", "British Grand Prix");
INSERT INTO "races" VALUES ("166", "2009", "9", "German Grand Prix");
INSERT INTO "races" VALUES ("167", "2009", "10", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("168", "2009", "11", "European Grand Prix");
INSERT INTO "races" VALUES ("169", "2009", "12", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("170", "2009", "13", "Italian Grand Prix");
INSERT INTO "races" VALUES ("171", "2009", "14", "Singapore Grand Prix");
INSERT INTO "races" VALUES ("172", "2009", "15", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("173", "2009", "16", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("174", "2009", "17", "Abu Dhabi Grand Prix");
INSERT INTO "races" VALUES ("175", "2010", "1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("176", "2010", "2", "Australian Grand Prix");
INSERT INTO "races" VALUES ("177", "2010", "3", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("178", "2010", "4", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("179", "2010", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("180", "2010", "6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("181", "2010", "7", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("182", "2010", "8", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("183", "2010", "9", "European Grand Prix");
INSERT INTO "races" VALUES ("184", "2010", "10", "British Grand Prix");
INSERT INTO "races" VALUES ("185", "2010", "11", "German Grand Prix");
INSERT INTO "races" VALUES ("186", "2010", "12", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("187", "2010", "13", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("188", "2010", "14", "Italian Grand Prix");
INSERT INTO "races" VALUES ("189", "2010", "15", "Singapore Grand Prix");
INSERT INTO "races" VALUES ("190", "2010", "16", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("191", "2010", "17", "Korean Grand Prix");
INSERT INTO "races" VALUES ("192", "2010", "18", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("193", "2010", "19", "Abu Dhabi Grand Prix");
INSERT INTO "races" VALUES ("194", "2011", "1", "Australian Grand Prix");
INSERT INTO "races" VALUES ("195", "2011", "2", "Malaysian Grand Prix");
INSERT INTO "races" VALUES ("196", "2011", "3", "Chinese Grand Prix");
INSERT INTO "races" VALUES ("197", "2011", "4", "Turkish Grand Prix");
INSERT INTO "races" VALUES ("198", "2011", "5", "Spanish Grand Prix");
INSERT INTO "races" VALUES ("199", "2011", "6", "Monaco Grand Prix");
INSERT INTO "races" VALUES ("200", "2011", "7", "Canadian Grand Prix");
INSERT INTO "races" VALUES ("201", "2011", "8", "European Grand Prix");
INSERT INTO "races" VALUES ("202", "2011", "9", "British Grand Prix");
INSERT INTO "races" VALUES ("203", "2011", "10", "German Grand Prix");
INSERT INTO "races" VALUES ("204", "2011", "11", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("205", "2011", "12", "Belgian Grand Prix");
INSERT INTO "races" VALUES ("206", "2011", "13", "Italian Grand Prix");
INSERT INTO "races" VALUES ("207", "2011", "14", "Singapore Grand Prix");
INSERT INTO "races" VALUES ("208", "2011", "15", "Japanese Grand Prix");
INSERT INTO "races" VALUES ("209", "2011", "16", "Korean Grand Prix");