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_goal" INT,
"away_team_goal" 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,
"goal" TEXT,
PRIMARY KEY ("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")
);

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

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



INSERT INTO "Player" VALUES ("1", "1001", "1995-05-10");
INSERT INTO "Player" VALUES ("2", "1002", "1988-01-15");
INSERT INTO "Player" VALUES ("3", "1003", "1990-03-20");
INSERT INTO "Player" VALUES ("4", "1004", "1992-07-01");
INSERT INTO "Player" VALUES ("5", "1005", "1985-11-25");
INSERT INTO "Player" VALUES ("6", "1006", "1998-02-14");
INSERT INTO "Player" VALUES ("7", "1007", "1987-09-05");
INSERT INTO "Player" VALUES ("8", "1008", "1993-04-18");
INSERT INTO "Player" VALUES ("9", "1009", "1991-06-30");
INSERT INTO "Player" VALUES ("10", "1010", "1989-12-12");
INSERT INTO "Player" VALUES ("11", "1011", "1996-08-03");
INSERT INTO "Player" VALUES ("12", "1012", "1986-02-28");
INSERT INTO "Player" VALUES ("13", "1013", "1994-10-07");
INSERT INTO "Player" VALUES ("14", "1014", "1984-03-01");
INSERT INTO "Player" VALUES ("15", "1015", "1997-01-22");
INSERT INTO "Match" VALUES ("1", "2", "1", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "H1:1001H1:1006A1:1012");
INSERT INTO "Match" VALUES ("2", "3", "0", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1001", "1013", "H1:1003H1:1008H1:1011");
INSERT INTO "Match" VALUES ("3", "1", "2", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1001", "1002", "1014", "H1:1004A1:1014A1:1015");
INSERT INTO "Match" VALUES ("4", "0", "0", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1001", "1002", "1003", "1015", "");
INSERT INTO "Match" VALUES ("5", "4", "1", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1001", "1002", "1003", "1004", "1012", "H1:1005H1:1009H1:1001H1:1004A1:1012");
INSERT INTO "Match" VALUES ("6", "2", "2", "1006", "1007", "1008", "1009", "1010", "1011", "1001", "1002", "1003", "1004", "1005", "1013", "H1:1006H1:1002A1:1013A1:1014");
INSERT INTO "Player_Attributes" VALUES ("1", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "78");
INSERT INTO "Player_Attributes" VALUES ("3", "88");
INSERT INTO "Player_Attributes" VALUES ("4", "82");
INSERT INTO "Player_Attributes" VALUES ("5", "75");
INSERT INTO "Player_Attributes" VALUES ("6", "90");
INSERT INTO "Player_Attributes" VALUES ("7", "79");
INSERT INTO "Player_Attributes" VALUES ("8", "86");
INSERT INTO "Player_Attributes" VALUES ("9", "81");
INSERT INTO "Player_Attributes" VALUES ("10", "77");
INSERT INTO "Player_Attributes" VALUES ("11", "89");
INSERT INTO "Player_Attributes" VALUES ("12", "76");
INSERT INTO "Player_Attributes" VALUES ("13", "83");
INSERT INTO "Player_Attributes" VALUES ("14", "74");
INSERT INTO "Player_Attributes" VALUES ("15", "80");