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

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



INSERT INTO "Player" VALUES ("1", "1001", "Aaron Lennon");
INSERT INTO "Player" VALUES ("2", "1002", "John Doe");
INSERT INTO "Player" VALUES ("3", "1003", "Jane Smith");
INSERT INTO "Player" VALUES ("4", "1004", "Peter Jones");
INSERT INTO "Player" VALUES ("5", "1005", "Alice Brown");
INSERT INTO "Player" VALUES ("6", "1006", "Bob White");
INSERT INTO "Player" VALUES ("7", "1007", "Charlie Green");
INSERT INTO "Player" VALUES ("8", "1008", "Diana Prince");
INSERT INTO "Player" VALUES ("9", "1009", "Bruce Wayne");
INSERT INTO "Player" VALUES ("10", "1010", "Clark Kent");
INSERT INTO "Player" VALUES ("11", "1011", "Lois Lane");
INSERT INTO "Player" VALUES ("12", "1012", "Barry Allen");
INSERT INTO "Player" VALUES ("13", "1013", "Arthur Curry");
INSERT INTO "Player" VALUES ("14", "1014", "Hal Jordan");
INSERT INTO "Player" VALUES ("15", "1015", "Oliver Queen");
INSERT INTO "Player" VALUES ("16", "1016", "Selina Kyle");
INSERT INTO "Player" VALUES ("17", "1017", "Harley Quinn");
INSERT INTO "Player" VALUES ("18", "1018", "Pamela Isley");
INSERT INTO "Player" VALUES ("19", "1019", "Victor Stone");
INSERT INTO "Player" VALUES ("20", "1020", "Billy Batson");
INSERT INTO "Match" VALUES ("1", "2", "1", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "{"1001": ["00:15", "00:45"], "1002": ["00:60"]}", "NULL");
INSERT INTO "Match" VALUES ("2", "1", "0", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "{"1002": ["00:30"]}", "NULL");
INSERT INTO "Match" VALUES ("3", "3", "2", "1001", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1013", "{"1001": ["00:10"], "1003": ["00:20"], "1004": ["00:50"]}", "NULL");
INSERT INTO "Match" VALUES ("4", "0", "0", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "1013", "1014", "{}", "NULL");
INSERT INTO "Match" VALUES ("5", "1", "1", "1001", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "1013", "1015", "{"1001": ["00:35"]}", "NULL");
INSERT INTO "Match" VALUES ("6", "2", "0", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "{"1001": ["00:25", "00:70"]}", "NULL");
INSERT INTO "Match" VALUES ("7", "1", "2", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "{"1003": ["00:15"]}", "NULL");
INSERT INTO "Match" VALUES ("8", "4", "1", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "{"1001": ["00:05", "00:25", "00:55"], "1002": ["00:80"]}", "NULL");
INSERT INTO "Match" VALUES ("9", "0", "3", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "1013", "1014", "1015", "{}", "NULL");
INSERT INTO "Match" VALUES ("10", "2", "2", "1001", "1003", "1005", "1007", "1009", "1011", "1013", "1015", "1017", "1019", "1020", "{"1001": ["00:40"], "1003": ["00:75"]}", "NULL");
INSERT INTO "Player_Attributes" VALUES ("1", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "78");
INSERT INTO "Player_Attributes" VALUES ("3", "82");
INSERT INTO "Player_Attributes" VALUES ("4", "75");
INSERT INTO "Player_Attributes" VALUES ("5", "80");
INSERT INTO "Player_Attributes" VALUES ("6", "70");
INSERT INTO "Player_Attributes" VALUES ("7", "72");
INSERT INTO "Player_Attributes" VALUES ("8", "88");
INSERT INTO "Player_Attributes" VALUES ("9", "90");
INSERT INTO "Player_Attributes" VALUES ("10", "87");
INSERT INTO "Player_Attributes" VALUES ("11", "79");
INSERT INTO "Player_Attributes" VALUES ("12", "81");
INSERT INTO "Player_Attributes" VALUES ("13", "76");
INSERT INTO "Player_Attributes" VALUES ("14", "83");
INSERT INTO "Player_Attributes" VALUES ("15", "74");
INSERT INTO "Player_Attributes" VALUES ("16", "86");
INSERT INTO "Player_Attributes" VALUES ("17", "71");
INSERT INTO "Player_Attributes" VALUES ("18", "73");
INSERT INTO "Player_Attributes" VALUES ("19", "89");
INSERT INTO "Player_Attributes" VALUES ("20", "91");