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,
"lat" 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", "Silverstone Circuit", "52.0786");
INSERT INTO "circuits" VALUES ("2", "Hockenheimring", "49.3277");
INSERT INTO "circuits" VALUES ("3", "Hungaroring", "47.5789");
INSERT INTO "circuits" VALUES ("4", "Monza", "45.6156");
INSERT INTO "circuits" VALUES ("5", "Spa-Francorchamps", "50.4372");
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 "drivers" VALUES ("1", "British");
INSERT INTO "drivers" VALUES ("2", "German");
INSERT INTO "drivers" VALUES ("3", "Hungarian");
INSERT INTO "drivers" VALUES ("4", "Italian");
INSERT INTO "races" VALUES ("1", "British Grand Prix");
INSERT INTO "races" VALUES ("2", "German Grand Prix");
INSERT INTO "races" VALUES ("3", "Hungarian Grand Prix");
INSERT INTO "races" VALUES ("4", "Italian Grand Prix");