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

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

CREATE TABLE "results" (
"resultId" INT,
"position" INT,
PRIMARY KEY ("resultId")
);



INSERT INTO "circuits" VALUES ("1", "Albert Park Grand Prix Circuit", "Melbourne");
INSERT INTO "circuits" VALUES ("2", "Sepang International Circuit", "Kuala Lumpur");
INSERT INTO "circuits" VALUES ("3", "Bahrain International Circuit", "Sakhir");
INSERT INTO "circuits" VALUES ("4", "Shanghai International Circuit", "Shanghai");
INSERT INTO "circuits" VALUES ("5", "Circuit de Barcelona-Catalunya", "Montmeló");
INSERT INTO "circuits" VALUES ("6", "Circuit de Monaco", "Monte Carlo");
INSERT INTO "circuits" VALUES ("7", "Circuit Gilles Villeneuve", "Montreal");
INSERT INTO "circuits" VALUES ("8", "Red Bull Ring", "Spielberg");
INSERT INTO "circuits" VALUES ("9", "Silverstone Circuit", "Silverstone");
INSERT INTO "circuits" VALUES ("10", "Hockenheimring", "Hockenheim");
INSERT INTO "races" VALUES ("1", "1999", "1", "Australian Grand Prix", "1999-03-07");
INSERT INTO "races" VALUES ("2", "1999", "2", "Brazilian Grand Prix", "1999-04-11");
INSERT INTO "races" VALUES ("3", "1999", "3", "San Marino Grand Prix", "1999-05-02");
INSERT INTO "races" VALUES ("4", "1999", "4", "Monaco Grand Prix", "1999-05-16");
INSERT INTO "races" VALUES ("5", "1999", "5", "Spanish Grand Prix", "1999-05-30");
INSERT INTO "races" VALUES ("6", "1999", "6", "Canadian Grand Prix", "1999-06-13");
INSERT INTO "races" VALUES ("7", "1999", "7", "French Grand Prix", "1999-06-27");
INSERT INTO "races" VALUES ("8", "1999", "8", "British Grand Prix", "1999-07-11");
INSERT INTO "races" VALUES ("9", "1999", "9", "Austrian Grand Prix", "1999-07-25");
INSERT INTO "races" VALUES ("10", "1999", "10", "German Grand Prix", "1999-08-01");
INSERT INTO "races" VALUES ("11", "1999", "11", "Hungarian Grand Prix", "1999-08-15");
INSERT INTO "races" VALUES ("12", "1999", "12", "Belgian Grand Prix", "1999-08-29");
INSERT INTO "races" VALUES ("13", "1999", "13", "Italian Grand Prix", "1999-09-12");
INSERT INTO "races" VALUES ("14", "1999", "14", "European Grand Prix", "1999-09-26");
INSERT INTO "races" VALUES ("15", "1999", "15", "Malaysian Grand Prix", "1999-10-17");
INSERT INTO "races" VALUES ("16", "1999", "16", "Japanese Grand Prix", "1999-10-31");
INSERT INTO "races" VALUES ("17", "2000", "1", "Australian Grand Prix", "2000-03-12");
INSERT INTO "races" VALUES ("18", "1998", "16", "Japanese Grand Prix", "1998-11-01");
INSERT INTO "results" VALUES ("1", "1");
INSERT INTO "results" VALUES ("2", "2");
INSERT INTO "results" VALUES ("3", "3");
INSERT INTO "results" VALUES ("4", "4");
INSERT INTO "results" VALUES ("5", "5");
INSERT INTO "results" VALUES ("6", "6");
INSERT INTO "results" VALUES ("7", "7");
INSERT INTO "results" VALUES ("8", "8");
INSERT INTO "results" VALUES ("9", "9");
INSERT INTO "results" VALUES ("10", "10");