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,
"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", "Italy");
INSERT INTO "Country" VALUES ("3", "Spain");
INSERT INTO "Country" VALUES ("4", "Germany");
INSERT INTO "Country" VALUES ("5", "France");
INSERT INTO "League" VALUES ("101", "1", "Premier League");
INSERT INTO "League" VALUES ("102", "2", "Italy Serie A");
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", "Italy Serie B");
INSERT INTO "Match" VALUES ("1001", "1", "101");
INSERT INTO "Match" VALUES ("1002", "2", "102");
INSERT INTO "Match" VALUES ("1003", "3", "103");
INSERT INTO "Match" VALUES ("1004", "1", "101");
INSERT INTO "Match" VALUES ("1005", "2", "102");
INSERT INTO "Match" VALUES ("1006", "1", "105");
INSERT INTO "Team" VALUES ("2001", "Manchester United");
INSERT INTO "Team" VALUES ("2002", "Juventus");
INSERT INTO "Team" VALUES ("2003", "Real Madrid");
INSERT INTO "Team" VALUES ("2004", "Bayern Munich");
INSERT INTO "Team" VALUES ("2005", "Chelsea");
INSERT INTO "Team" VALUES ("2006", "AC Milan");