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_player_1" INT,
PRIMARY KEY ("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,
"player_api_id" INT,
"overall_rating" INT,
"preferred_foot" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id")
);

CREATE TABLE "Team" (
"id" INT,
"team_long_name" TEXT,
PRIMARY KEY ("id")
);



INSERT INTO "Player" VALUES ("1", "1001", "Lionel Messi");
INSERT INTO "Player" VALUES ("2", "1002", "Cristiano Ronaldo");
INSERT INTO "Player" VALUES ("3", "1003", "Neymar Jr.");
INSERT INTO "Player" VALUES ("4", "1004", "Mohamed Salah");
INSERT INTO "Player" VALUES ("5", "1005", "Kevin De Bruyne");
INSERT INTO "Player" VALUES ("6", "1006", "Antoine Griezmann");
INSERT INTO "Player" VALUES ("7", "1007", "Eden Hazard");
INSERT INTO "Player" VALUES ("8", "1008", "Sergio Ramos");
INSERT INTO "Player" VALUES ("9", "1009", "Virgil van Dijk");
INSERT INTO "Player" VALUES ("10", "1010", "Robert Lewandowski");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "94", "left");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "93", "right");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "92", "right");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "90", "left");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "91", "right");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "89", "left");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "91", "right");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "89", "right");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "90", "right");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "91", "right");
INSERT INTO "Player_Attributes" VALUES ("11", "1011", "85", "left");
INSERT INTO "Player_Attributes" VALUES ("12", "1012", "82", "left");
INSERT INTO "Player_Attributes" VALUES ("13", "1013", "88", "right");
INSERT INTO "Player_Attributes" VALUES ("14", "1014", "87", "left");
INSERT INTO "Player_Attributes" VALUES ("15", "1015", "84", "right");
INSERT INTO "Match" VALUES ("1", "1001");
INSERT INTO "Match" VALUES ("2", "1002");
INSERT INTO "Match" VALUES ("3", "1003");
INSERT INTO "Match" VALUES ("4", "1004");
INSERT INTO "Match" VALUES ("5", "1005");
INSERT INTO "Match" VALUES ("6", "1006");
INSERT INTO "Match" VALUES ("7", "1007");
INSERT INTO "Match" VALUES ("8", "1008");
INSERT INTO "Match" VALUES ("9", "1009");
INSERT INTO "Match" VALUES ("10", "1010");
INSERT INTO "Team" VALUES ("1", "FC Barcelona");
INSERT INTO "Team" VALUES ("2", "Real Madrid");
INSERT INTO "Team" VALUES ("3", "Paris Saint-Germain");
INSERT INTO "Team" VALUES ("4", "Liverpool FC");
INSERT INTO "Team" VALUES ("5", "Manchester City");
INSERT INTO "Team" VALUES ("6", "Atletico Madrid");
INSERT INTO "Team" VALUES ("7", "Chelsea FC");
INSERT INTO "Team" VALUES ("8", "Bayern Munich");
INSERT INTO "Team" VALUES ("9", "Juventus FC");
INSERT INTO "Team" VALUES ("10", "Borussia Dortmund");