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,
PRIMARY KEY ("circuitId")
);

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

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

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



INSERT INTO "circuits" VALUES ("1", "USA");
INSERT INTO "circuits" VALUES ("2", "Canada");
INSERT INTO "circuits" VALUES ("3", "UK");
INSERT INTO "circuits" VALUES ("4", "Monaco");
INSERT INTO "circuits" VALUES ("5", "Australia");
INSERT INTO "constructors" VALUES ("1", "British");
INSERT INTO "constructors" VALUES ("2", "American");
INSERT INTO "constructors" VALUES ("3", "German");
INSERT INTO "constructors" VALUES ("4", "Italian");
INSERT INTO "constructors" VALUES ("5", "French");
INSERT INTO "drivers" VALUES ("1", "HAM", "British");
INSERT INTO "drivers" VALUES ("2", "VER", "Dutch");
INSERT INTO "drivers" VALUES ("3", "LEC", "Monegasque");
INSERT INTO "drivers" VALUES ("4", "RIC", "Australian");
INSERT INTO "drivers" VALUES ("5", "ALO", "Spanish");
INSERT INTO "drivers" VALUES ("6", "PER", "Mexican");
INSERT INTO "drivers" VALUES ("7", "ALB", "Thai");
INSERT INTO "drivers" VALUES ("8", "SAR", "American");
INSERT INTO "drivers" VALUES ("9", "LOG", "American");
INSERT INTO "drivers" VALUES ("10", "NOR", "British");
INSERT INTO "races" VALUES ("1", "Bahrain Grand Prix");
INSERT INTO "races" VALUES ("2", "Saudi Arabian Grand Prix");
INSERT INTO "races" VALUES ("3", "Australian Grand Prix");
INSERT INTO "races" VALUES ("4", "Azerbaijan Grand Prix");
INSERT INTO "races" VALUES ("5", "Miami Grand Prix");