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 UNIQUE,
"location" TEXT,
"country" TEXT,
"lat" FLOAT,
"alt" INT,
PRIMARY KEY ("circuitId")
);

CREATE TABLE "races" (
"raceId" INT,
"circuitId" INT,
PRIMARY KEY ("raceId"),
FOREIGN KEY ("circuitId") REFERENCES "circuits"("circuitId")
);



INSERT INTO "circuits" VALUES ("1", "Melbourne", "Australia", "-37.8497", "10");
INSERT INTO "circuits" VALUES ("2", "Sepang", "Malaysia", "2.76083", "18");
INSERT INTO "circuits" VALUES ("3", "Sakhir", "Bahrain", "26.0325", "7");
INSERT INTO "circuits" VALUES ("4", "Shanghai", "China", "31.3389", "5");
INSERT INTO "circuits" VALUES ("5", "Barcelona", "Spain", "41.57", "100");
INSERT INTO "circuits" VALUES ("6", "Monte Carlo", "Monaco", "43.7347", "15");
INSERT INTO "circuits" VALUES ("7", "Montreal", "Canada", "45.5", "13");
INSERT INTO "circuits" VALUES ("8", "Silverstone", "UK", "52.0786", "153");
INSERT INTO "circuits" VALUES ("9", "Hockenheim", "Germany", "49.3278", "103");
INSERT INTO "circuits" VALUES ("10", "Hungaroring", "Hungary", "47.5789", "109");
INSERT INTO "circuits" VALUES ("11", "Spa-Francorchamps", "Belgium", "50.4367", "400");
INSERT INTO "circuits" VALUES ("12", "Monza", "Italy", "45.6156", "162");
INSERT INTO "circuits" VALUES ("13", "Singapore", "Singapore", "1.29167", "18");
INSERT INTO "circuits" VALUES ("14", "Suzuka", "Japan", "34.8431", "40");
INSERT INTO "circuits" VALUES ("15", "Abu Dhabi", "UAE", "24.4672", "3");
INSERT INTO "circuits" VALUES ("16", "Interlagos", "Brazil", "-23.7036", "786");
INSERT INTO "circuits" VALUES ("17", "Austin", "USA", "30.1328", "168");
INSERT INTO "circuits" VALUES ("18", "Mexico City", "Mexico", "19.4042", "2229");
INSERT INTO "circuits" VALUES ("19", "Sochi", "Russia", "43.4058", "2");
INSERT INTO "circuits" VALUES ("20", "Spielberg", "Austria", "47.2197", "660");
INSERT INTO "circuits" VALUES ("21", "Baku", "Azerbaijan", "40.3725", "10");
INSERT INTO "circuits" VALUES ("22", "Jeddah", "Saudi Arabia", "21.6319", "15");
INSERT INTO "circuits" VALUES ("23", "Miami", "USA", "25.9581", "1");
INSERT INTO "circuits" VALUES ("24", "Las Vegas", "USA", "36.1147", "610");
INSERT INTO "circuits" VALUES ("25", "Zandvoort", "Netherlands", "52.3889", "3");
INSERT INTO "races" VALUES ("1", "1");
INSERT INTO "races" VALUES ("2", "2");
INSERT INTO "races" VALUES ("3", "3");
INSERT INTO "races" VALUES ("4", "4");
INSERT INTO "races" VALUES ("5", "5");
INSERT INTO "races" VALUES ("6", "6");
INSERT INTO "races" VALUES ("7", "7");
INSERT INTO "races" VALUES ("8", "8");
INSERT INTO "races" VALUES ("9", "9");
INSERT INTO "races" VALUES ("10", "10");
INSERT INTO "races" VALUES ("11", "11");
INSERT INTO "races" VALUES ("12", "12");
INSERT INTO "races" VALUES ("13", "13");
INSERT INTO "races" VALUES ("14", "14");
INSERT INTO "races" VALUES ("15", "15");
INSERT INTO "races" VALUES ("16", "16");
INSERT INTO "races" VALUES ("17", "17");
INSERT INTO "races" VALUES ("18", "18");
INSERT INTO "races" VALUES ("19", "19");
INSERT INTO "races" VALUES ("20", "20");
INSERT INTO "races" VALUES ("21", "21");
INSERT INTO "races" VALUES ("22", "22");
INSERT INTO "races" VALUES ("23", "23");
INSERT INTO "races" VALUES ("24", "24");
INSERT INTO "races" VALUES ("25", "25");