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 "Match" (
"id" INT,
"home_team_api_id" INT,
"away_team_api_id" INT,
"home_team_goal" INT,
"away_team_goal" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("away_team_api_id") REFERENCES "Team"("team_api_id"),
FOREIGN KEY ("home_team_api_id") REFERENCES "Team"("team_api_id")
);

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



INSERT INTO "Team" VALUES ("1", "1001", "Manchester United", "MUN");
INSERT INTO "Team" VALUES ("2", "1002", "Liverpool FC", "LIV");
INSERT INTO "Team" VALUES ("3", "1003", "Arsenal FC", "ARS");
INSERT INTO "Team" VALUES ("4", "1004", "Chelsea FC", "CHE");
INSERT INTO "Team" VALUES ("5", "1005", "Tottenham Hotspur", "TOT");
INSERT INTO "Team" VALUES ("6", "1006", "Everton FC", "EVE");
INSERT INTO "Team" VALUES ("7", "1007", "Leicester City", "LEI");
INSERT INTO "Team" VALUES ("8", "1008", "West Ham United", "WHU");
INSERT INTO "Team" VALUES ("9", "1009", "Southampton FC", "SOU");
INSERT INTO "Team" VALUES ("10", "1010", "Crystal Palace", "CRY");
INSERT INTO "Match" VALUES ("1", "1001", "1002", "2", "1");
INSERT INTO "Match" VALUES ("2", "1003", "1004", "1", "0");
INSERT INTO "Match" VALUES ("3", "1005", "1006", "3", "2");
INSERT INTO "Match" VALUES ("4", "1007", "1008", "0", "0");
INSERT INTO "Match" VALUES ("5", "1009", "1010", "4", "1");
INSERT INTO "Match" VALUES ("6", "1001", "1003", "10", "0");
INSERT INTO "Match" VALUES ("7", "1002", "1004", "1", "5");
INSERT INTO "Match" VALUES ("8", "1005", "1007", "10", "1");
INSERT INTO "Match" VALUES ("9", "1006", "1008", "2", "2");
INSERT INTO "Match" VALUES ("10", "1009", "1001", "0", "3");
INSERT INTO "Match" VALUES ("11", "1004", "1005", "10", "0");
INSERT INTO "Match" VALUES ("12", "1002", "1006", "10", "3");
INSERT INTO "Match" VALUES ("13", "1007", "1009", "1", "1");
INSERT INTO "Match" VALUES ("14", "1008", "1010", "0", "2");
INSERT INTO "Match" VALUES ("15", "1003", "1002", "10", "0");