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,
"date" TEXT,
"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_8" INT,
"goal" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("away_player_8") 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", "101", "1995-05-20");
INSERT INTO "Player" VALUES ("2", "102", "1988-11-15");
INSERT INTO "Player" VALUES ("3", "103", "1993-07-10");
INSERT INTO "Player" VALUES ("4", "104", "1990-12-01");
INSERT INTO "Player" VALUES ("5", "105", "1985-03-30");
INSERT INTO "Player" VALUES ("6", "106", "1997-08-25");
INSERT INTO "Player" VALUES ("7", "107", "1992-01-05");
INSERT INTO "Player" VALUES ("8", "108", "1989-09-17");
INSERT INTO "Player" VALUES ("9", "109", "1994-04-12");
INSERT INTO "Player" VALUES ("10", "110", "2000-06-22");
INSERT INTO "Player" VALUES ("11", "111", "1987-02-28");
INSERT INTO "Player" VALUES ("12", "112", "1996-10-10");
INSERT INTO "Player" VALUES ("13", "113", "1991-11-11");
INSERT INTO "Player" VALUES ("14", "114", "1983-07-07");
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", "80");
INSERT INTO "Player_Attributes" VALUES ("5", "75");
INSERT INTO "Player_Attributes" VALUES ("6", "88");
INSERT INTO "Player_Attributes" VALUES ("7", "79");
INSERT INTO "Player_Attributes" VALUES ("8", "77");
INSERT INTO "Player_Attributes" VALUES ("9", "83");
INSERT INTO "Player_Attributes" VALUES ("10", "90");
INSERT INTO "Player_Attributes" VALUES ("11", "74");
INSERT INTO "Player_Attributes" VALUES ("12", "81");
INSERT INTO "Player_Attributes" VALUES ("13", "76");
INSERT INTO "Player_Attributes" VALUES ("14", "70");