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,
"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_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", "Daan Smith");
INSERT INTO "Player" VALUES ("2", "1002", "Filipe Ferreira");
INSERT INTO "Player" VALUES ("3", "1003", "John Doe");
INSERT INTO "Player" VALUES ("4", "1004", "Jane Smith");
INSERT INTO "Player" VALUES ("5", "1005", "Peter Jones");
INSERT INTO "Player" VALUES ("6", "1006", "Alice Brown");
INSERT INTO "Player" VALUES ("7", "1007", "Bob White");
INSERT INTO "Player" VALUES ("8", "1008", "Charlie Green");
INSERT INTO "Player" VALUES ("9", "1009", "Diana Prince");
INSERT INTO "Player" VALUES ("10", "1010", "Bruce Wayne");
INSERT INTO "Player" VALUES ("11", "1011", "Clark Kent");
INSERT INTO "Player" VALUES ("12", "1012", "Lois Lane");
INSERT INTO "Player" VALUES ("13", "1013", "Barry Allen");
INSERT INTO "Player" VALUES ("14", "1014", "Arthur Curry");
INSERT INTO "Player" VALUES ("15", "1015", "Hal Jordan");
INSERT INTO "Match" VALUES ("1", "2", "1", "1003", "1001", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1012", "NULL");
INSERT INTO "Match" VALUES ("2", "0", "3", "1004", "1002", "1003", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1013", "NULL");
INSERT INTO "Match" VALUES ("3", "1", "2", "1005", "1001", "1002", "1004", "1006", "1007", "1008", "1009", "1010", "1011", "1014", "NULL");
INSERT INTO "Match" VALUES ("4", "3", "0", "1006", "1003", "1004", "1005", "1001", "1007", "1008", "1009", "1010", "1011", "1015", "NULL");
INSERT INTO "Match" VALUES ("5", "1", "4", "1007", "1002", "1003", "1004", "1005", "1006", "1008", "1009", "1010", "1011", "1001", "NULL");
INSERT INTO "Match" VALUES ("6", "0", "0", "1008", "1003", "1004", "1005", "1006", "1007", "1009", "1010", "1011", "1012", "1013", "NULL");
INSERT INTO "Match" VALUES ("7", "2", "1", "1009", "1001", "1003", "1004", "1005", "1006", "1007", "1008", "1010", "1011", "1012", "NULL");
INSERT INTO "Match" VALUES ("8", "1", "2", "1010", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1011", "1013", "NULL");
INSERT INTO "Match" VALUES ("9", "0", "5", "1011", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "NULL");
INSERT INTO "Match" VALUES ("10", "3", "1", "1012", "1003", "1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011", "1002", "NULL");
INSERT INTO "Player_Attributes" VALUES ("1", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "88");
INSERT INTO "Player_Attributes" VALUES ("3", "75");
INSERT INTO "Player_Attributes" VALUES ("4", "78");
INSERT INTO "Player_Attributes" VALUES ("5", "80");
INSERT INTO "Player_Attributes" VALUES ("6", "72");
INSERT INTO "Player_Attributes" VALUES ("7", "81");
INSERT INTO "Player_Attributes" VALUES ("8", "76");
INSERT INTO "Player_Attributes" VALUES ("9", "89");
INSERT INTO "Player_Attributes" VALUES ("10", "90");
INSERT INTO "Player_Attributes" VALUES ("11", "87");
INSERT INTO "Player_Attributes" VALUES ("12", "70");
INSERT INTO "Player_Attributes" VALUES ("13", "84");
INSERT INTO "Player_Attributes" VALUES ("14", "83");
INSERT INTO "Player_Attributes" VALUES ("15", "82");