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 "Country" (
"id" INT UNIQUE,
"name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "League" (
"id" INT UNIQUE,
"country_id" INT,
"name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Match" (
"id" INT,
"country_id" INT,
"league_id" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("league_id") REFERENCES "League"("id"),
FOREIGN KEY ("country_id") REFERENCES "Country"("id")
);

CREATE TABLE "Team" (
"id" INT,
"team_long_name" TEXT,
PRIMARY KEY ("id")
);



INSERT INTO "Country" VALUES ("1", "England");
INSERT INTO "Country" VALUES ("2", "Netherlands");
INSERT INTO "Country" VALUES ("3", "Spain");
INSERT INTO "Country" VALUES ("4", "Germany");
INSERT INTO "Country" VALUES ("5", "Italy");
INSERT INTO "League" VALUES ("101", "1", "Premier League");
INSERT INTO "League" VALUES ("102", "2", "Eredivisie");
INSERT INTO "League" VALUES ("103", "3", "La Liga");
INSERT INTO "League" VALUES ("104", "4", "Bundesliga");
INSERT INTO "League" VALUES ("105", "1", "Championship");
INSERT INTO "League" VALUES ("106", "2", "Eerste Divisie");
INSERT INTO "Match" VALUES ("1", "1", "101");
INSERT INTO "Match" VALUES ("2", "2", "102");
INSERT INTO "Match" VALUES ("3", "3", "103");
INSERT INTO "Match" VALUES ("4", "1", "101");
INSERT INTO "Match" VALUES ("5", "2", "106");
INSERT INTO "Match" VALUES ("6", "4", "104");
INSERT INTO "Team" VALUES ("1001", "Manchester United");
INSERT INTO "Team" VALUES ("1002", "Ajax");
INSERT INTO "Team" VALUES ("1003", "Real Madrid");
INSERT INTO "Team" VALUES ("1004", "Bayern Munich");
INSERT INTO "Team" VALUES ("1005", "PSV Eindhoven");