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

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



INSERT INTO "circuits" VALUES ("1", "Silverstone Circuit", "Silverstone", "52.0786", "-1.0169");
INSERT INTO "circuits" VALUES ("2", "Monza", "Monza", "45.6156", "9.2811");
INSERT INTO "circuits" VALUES ("3", "Circuit de Monaco", "Monte Carlo", "43.7347", "7.4206");
INSERT INTO "circuits" VALUES ("4", "Circuit de Spa-Francorchamps", "Spa", "50.4372", "5.9714");
INSERT INTO "circuits" VALUES ("5", "Suzuka Circuit", "Suzuka", "34.8431", "136.538");
INSERT INTO "circuits" VALUES ("6", "Circuit Gilles Villeneuve", "Montreal", "45.5000", "-73.5228");
INSERT INTO "circuits" VALUES ("7", "Hungaroring", "Budapest", "47.5789", "19.2511");
INSERT INTO "circuits" VALUES ("8", "Yas Marina Circuit", "Abu Dhabi", "24.4672", "54.6031");
INSERT INTO "circuits" VALUES ("9", "Circuit of the Americas", "Austin", "30.1328", "-97.6411");
INSERT INTO "circuits" VALUES ("10", "Autódromo José Carlos Pace", "São Paulo", "-23.7036", "-46.6997");
INSERT INTO "races" VALUES ("1", "British Grand Prix", "2023-07-09");
INSERT INTO "races" VALUES ("2", "Italian Grand Prix", "2023-09-03");
INSERT INTO "races" VALUES ("3", "Monaco Grand Prix", "2023-05-28");
INSERT INTO "races" VALUES ("4", "Belgian Grand Prix", "2023-07-30");
INSERT INTO "races" VALUES ("5", "Japanese Grand Prix", "2023-09-24");
INSERT INTO "races" VALUES ("6", "Canadian Grand Prix", "2023-06-18");
INSERT INTO "races" VALUES ("7", "Hungarian Grand Prix", "2023-07-23");
INSERT INTO "races" VALUES ("8", "Abu Dhabi Grand Prix", "2023-11-26");
INSERT INTO "races" VALUES ("9", "United States Grand Prix", "2023-10-22");
INSERT INTO "races" VALUES ("10", "Brazilian Grand Prix", "2023-11-05");