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

CREATE TABLE "constructors" (
"constructorId" INT,
"nationality" TEXT,
PRIMARY KEY ("constructorId")
);

CREATE TABLE "drivers" (
"driverId" INT,
"nationality" TEXT,
PRIMARY KEY ("driverId")
);

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



INSERT INTO "circuits" VALUES ("1", "USA", "30.1328", "-97.6411");
INSERT INTO "circuits" VALUES ("2", "UK", "52.0786", "-1.01694");
INSERT INTO "circuits" VALUES ("3", "Italy", "45.6175", "13.7644");
INSERT INTO "circuits" VALUES ("4", "USA", "33.4372", "-112.187");
INSERT INTO "circuits" VALUES ("5", "Brazil", "-23.7036", "-46.6997");
INSERT INTO "circuits" VALUES ("6", "USA", "40.7361", "-74.0778");
INSERT INTO "circuits" VALUES ("7", "Canada", "45.5000", "-73.5228");
INSERT INTO "circuits" VALUES ("8", "USA", "39.7950", "-86.2347");
INSERT INTO "circuits" VALUES ("9", "Japan", "37.2272", "140.376");
INSERT INTO "circuits" VALUES ("10", "USA", "34.0522", "-118.243");
INSERT INTO "constructors" VALUES ("1", "British");
INSERT INTO "constructors" VALUES ("2", "German");
INSERT INTO "constructors" VALUES ("3", "Italian");
INSERT INTO "constructors" VALUES ("4", "French");
INSERT INTO "constructors" VALUES ("5", "American");
INSERT INTO "drivers" VALUES ("1", "British");
INSERT INTO "drivers" VALUES ("2", "German");
INSERT INTO "drivers" VALUES ("3", "Spanish");
INSERT INTO "drivers" VALUES ("4", "Finnish");
INSERT INTO "drivers" VALUES ("5", "American");
INSERT INTO "races" VALUES ("1", "United States Grand Prix");
INSERT INTO "races" VALUES ("2", "British Grand Prix");
INSERT INTO "races" VALUES ("3", "Italian Grand Prix");
INSERT INTO "races" VALUES ("4", "Brazilian Grand Prix");
INSERT INTO "races" VALUES ("5", "Canadian Grand Prix");