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 FC", "MUN");
INSERT INTO "Team" VALUES ("2", "1002", "Real Madrid CF", "RMD");
INSERT INTO "Team" VALUES ("3", "1003", "FC Barcelona", "BAR");
INSERT INTO "Team" VALUES ("4", "1004", "Bayern Munich", "BAY");
INSERT INTO "Team" VALUES ("5", "1005", "Juventus FC", "JUV");
INSERT INTO "Team" VALUES ("6", "1006", "Paris Saint-Germain", "PSG");
INSERT INTO "Team" VALUES ("7", "1007", "Liverpool FC", "LIV");
INSERT INTO "Team" VALUES ("8", "1008", "Chelsea FC", "CHE");
INSERT INTO "Team" VALUES ("9", "1009", "Borussia Dortmund", "DOR");
INSERT INTO "Team" VALUES ("10", "1010", "AC Milan", "MIL");
INSERT INTO "Match" VALUES ("1", "1001", "1002", "10", "2");
INSERT INTO "Match" VALUES ("2", "1003", "1004", "3", "1");
INSERT INTO "Match" VALUES ("3", "1005", "1006", "0", "0");
INSERT INTO "Match" VALUES ("4", "1007", "1008", "10", "5");
INSERT INTO "Match" VALUES ("5", "1009", "1010", "1", "2");
INSERT INTO "Match" VALUES ("6", "1002", "1003", "4", "4");
INSERT INTO "Match" VALUES ("7", "1004", "1005", "10", "0");
INSERT INTO "Match" VALUES ("8", "1006", "1007", "2", "3");
INSERT INTO "Match" VALUES ("9", "1008", "1009", "1", "1");
INSERT INTO "Match" VALUES ("10", "1010", "1001", "0", "10");