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

CREATE TABLE "Match" (
"id" INT,
"country_id" INT,
"home_player_1" INT,
"home_player_2" INT,
"home_player_3" INT,
"home_player_4" INT,
"home_player_5" INT,
"home_player_6" INT,
"home_player_7" INT,
"home_player_8" INT,
"home_player_9" INT,
"home_player_10" INT,
"home_player_11" INT,
"away_player_1" INT,
"away_player_2" INT,
"away_player_3" INT,
"away_player_4" INT,
"away_player_5" INT,
"away_player_6" INT,
"away_player_7" INT,
"away_player_8" INT,
"away_player_9" INT,
"away_player_10" INT,
"away_player_11" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("away_player_11") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_10") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_9") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_8") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_7") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_6") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_5") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_4") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_3") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_2") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("away_player_1") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_11") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_10") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_9") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_8") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_7") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_6") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_5") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_4") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_3") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_2") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("home_player_1") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("country_id") REFERENCES "Country"("id")
);

CREATE TABLE "Player" (
"id" INT,
"player_api_id" INT UNIQUE,
"weight" INT,
PRIMARY KEY ("id")
);

CREATE TABLE "Player_Attributes" (
"id" INT,
"overall_rating" INT,
PRIMARY KEY ("id")
);

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



INSERT INTO "Country" VALUES ("1", "England");
INSERT INTO "Country" VALUES ("2", "Spain");
INSERT INTO "Country" VALUES ("3", "Germany");
INSERT INTO "Country" VALUES ("4", "Italy");
INSERT INTO "Country" VALUES ("5", "France");
INSERT INTO "League" VALUES ("1001", "Premier League");
INSERT INTO "League" VALUES ("1002", "La Liga");
INSERT INTO "League" VALUES ("1003", "Bundesliga");
INSERT INTO "League" VALUES ("1004", "Serie A");
INSERT INTO "League" VALUES ("1005", "Ligue 1");
INSERT INTO "Player" VALUES ("1", "10001", "75");
INSERT INTO "Player" VALUES ("2", "10002", "80");
INSERT INTO "Player" VALUES ("3", "10003", "70");
INSERT INTO "Player" VALUES ("4", "10004", "85");
INSERT INTO "Player" VALUES ("5", "10005", "78");
INSERT INTO "Player" VALUES ("6", "10006", "90");
INSERT INTO "Player" VALUES ("7", "10007", "72");
INSERT INTO "Player" VALUES ("8", "10008", "82");
INSERT INTO "Player" VALUES ("9", "10009", "76");
INSERT INTO "Player" VALUES ("10", "10010", "88");
INSERT INTO "Player" VALUES ("11", "10011", "73");
INSERT INTO "Player" VALUES ("12", "10012", "81");
INSERT INTO "Player" VALUES ("13", "10013", "79");
INSERT INTO "Player" VALUES ("14", "10014", "86");
INSERT INTO "Player" VALUES ("15", "10015", "71");
INSERT INTO "Player" VALUES ("16", "10016", "92");
INSERT INTO "Player" VALUES ("17", "10017", "74");
INSERT INTO "Player" VALUES ("18", "10018", "83");
INSERT INTO "Player" VALUES ("19", "10019", "77");
INSERT INTO "Player" VALUES ("20", "10020", "89");
INSERT INTO "Player" VALUES ("21", "10021", "95");
INSERT INTO "Player" VALUES ("22", "10022", "93");
INSERT INTO "Player" VALUES ("23", "10023", "91");
INSERT INTO "Player" VALUES ("24", "10024", "94");
INSERT INTO "Player" VALUES ("25", "10025", "96");
INSERT INTO "Player" VALUES ("26", "10026", "65");
INSERT INTO "Player" VALUES ("27", "10027", "68");
INSERT INTO "Player" VALUES ("28", "10028", "62");
INSERT INTO "Player" VALUES ("29", "10029", "60");
INSERT INTO "Player" VALUES ("30", "10030", "63");
INSERT INTO "Match" VALUES ("1", "1", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10009", "10010", "10011", "10012", "10013", "10014", "10015", "10016", "10017", "10018", "10019", "10020", "10021", "10022");
INSERT INTO "Match" VALUES ("2", "2", "10012", "10013", "10014", "10015", "10016", "10017", "10018", "10019", "10020", "10021", "10022", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10009", "10010", "10011");
INSERT INTO "Match" VALUES ("3", "3", "10023", "10024", "10025", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10009", "10010", "10011", "10012", "10013", "10014", "10015", "10016", "10017", "10018", "10019");
INSERT INTO "Match" VALUES ("4", "4", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10009", "10010", "10011", "10023", "10024", "10025", "10026", "10027", "10028", "10029", "10030", "10001", "10002", "10003");
INSERT INTO "Match" VALUES ("5", "5", "10026", "10027", "10028", "10029", "10030", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10009", "10010", "10011", "10012", "10013", "10014", "10015", "10016", "10017");
INSERT INTO "Match" VALUES ("6", "1", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10009", "10010", "10011", "10023", "10024", "10025", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008");
INSERT INTO "Match" VALUES ("7", "2", "10023", "10024", "10025", "10001", "10002", "10003", "10004", "10005", "10006", "10007", "10008", "10026", "10027", "10028", "10029", "10030", "10001", "10002", "10003", "10004", "10005", "10006");
INSERT INTO "Player_Attributes" VALUES ("1", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "88");
INSERT INTO "Player_Attributes" VALUES ("3", "80");
INSERT INTO "Player_Attributes" VALUES ("4", "90");
INSERT INTO "Player_Attributes" VALUES ("5", "82");
INSERT INTO "Player_Attributes" VALUES ("6", "92");
INSERT INTO "Player_Attributes" VALUES ("7", "78");
INSERT INTO "Player_Attributes" VALUES ("8", "87");
INSERT INTO "Player_Attributes" VALUES ("9", "81");
INSERT INTO "Player_Attributes" VALUES ("10", "89");
INSERT INTO "Player_Attributes" VALUES ("11", "79");
INSERT INTO "Player_Attributes" VALUES ("12", "86");
INSERT INTO "Player_Attributes" VALUES ("13", "83");
INSERT INTO "Player_Attributes" VALUES ("14", "91");
INSERT INTO "Player_Attributes" VALUES ("15", "77");
INSERT INTO "Player_Attributes" VALUES ("16", "93");
INSERT INTO "Player_Attributes" VALUES ("17", "80");
INSERT INTO "Player_Attributes" VALUES ("18", "88");
INSERT INTO "Player_Attributes" VALUES ("19", "82");
INSERT INTO "Player_Attributes" VALUES ("20", "90");
INSERT INTO "Player_Attributes" VALUES ("21", "95");
INSERT INTO "Player_Attributes" VALUES ("22", "93");
INSERT INTO "Player_Attributes" VALUES ("23", "91");
INSERT INTO "Player_Attributes" VALUES ("24", "94");
INSERT INTO "Player_Attributes" VALUES ("25", "96");
INSERT INTO "Player_Attributes" VALUES ("26", "65");
INSERT INTO "Player_Attributes" VALUES ("27", "68");
INSERT INTO "Player_Attributes" VALUES ("28", "62");
INSERT INTO "Player_Attributes" VALUES ("29", "60");
INSERT INTO "Player_Attributes" VALUES ("30", "63");
INSERT INTO "Team" VALUES ("1", "Manchester United");
INSERT INTO "Team" VALUES ("2", "Real Madrid");
INSERT INTO "Team" VALUES ("3", "Bayern Munich");
INSERT INTO "Team" VALUES ("4", "Juventus");
INSERT INTO "Team" VALUES ("5", "Paris Saint-Germain");