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,
"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", "101", "Aaron Lennon");
INSERT INTO "Player" VALUES ("2", "102", "John Smith");
INSERT INTO "Player" VALUES ("3", "103", "David Beckham");
INSERT INTO "Player" VALUES ("4", "104", "Cristiano Ronaldo");
INSERT INTO "Player" VALUES ("5", "105", "Lionel Messi");
INSERT INTO "Player" VALUES ("6", "106", "Wayne Rooney");
INSERT INTO "Player" VALUES ("7", "107", "Neymar Jr");
INSERT INTO "Player" VALUES ("8", "108", "Kylian Mbappe");
INSERT INTO "Player" VALUES ("9", "109", "Sergio Ramos");
INSERT INTO "Player" VALUES ("10", "110", "Luka Modric");
INSERT INTO "Player" VALUES ("11", "111", "Paul Pogba");
INSERT INTO "Player" VALUES ("12", "112", "Eden Hazard");
INSERT INTO "Player" VALUES ("13", "113", "Robert Lewandowski");
INSERT INTO "Player" VALUES ("14", "114", "Kevin De Bruyne");
INSERT INTO "Player" VALUES ("15", "115", "Mohamed Salah");
INSERT INTO "Player_Attributes" VALUES ("1", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "70");
INSERT INTO "Player_Attributes" VALUES ("3", "88");
INSERT INTO "Player_Attributes" VALUES ("4", "92");
INSERT INTO "Player_Attributes" VALUES ("5", "94");
INSERT INTO "Player_Attributes" VALUES ("6", "87");
INSERT INTO "Player_Attributes" VALUES ("7", "90");
INSERT INTO "Player_Attributes" VALUES ("8", "89");
INSERT INTO "Player_Attributes" VALUES ("9", "86");
INSERT INTO "Player_Attributes" VALUES ("10", "88");
INSERT INTO "Player_Attributes" VALUES ("11", "84");
INSERT INTO "Player_Attributes" VALUES ("12", "83");
INSERT INTO "Player_Attributes" VALUES ("13", "91");
INSERT INTO "Player_Attributes" VALUES ("14", "89");
INSERT INTO "Player_Attributes" VALUES ("15", "88");