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

CREATE TABLE "Player_Attributes" (
"id" INT,
"player_api_id" INT,
"overall_rating" INT,
"volleys" INT,
"dribbling" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id")
);



INSERT INTO "Player" VALUES ("1", "1001", "Lionel Messi", "1987-06-24");
INSERT INTO "Player" VALUES ("2", "1002", "Cristiano Ronaldo", "1985-02-05");
INSERT INTO "Player" VALUES ("3", "1003", "Neymar Jr", "1992-02-05");
INSERT INTO "Player" VALUES ("4", "1004", "Kylian Mbappe", "1998-12-20");
INSERT INTO "Player" VALUES ("5", "1005", "Luka Modric", "1985-09-09");
INSERT INTO "Player" VALUES ("6", "1006", "Sergio Ramos", "1986-03-30");
INSERT INTO "Player" VALUES ("7", "1007", "Andres Iniesta", "1984-05-11");
INSERT INTO "Player" VALUES ("8", "1008", "Zlatan Ibrahimovic", "1981-10-03");
INSERT INTO "Player" VALUES ("9", "1009", "Paul Pogba", "1993-03-15");
INSERT INTO "Player" VALUES ("10", "1010", "Eden Hazard", "1991-01-07");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "94", "85", "95");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "93", "80", "88");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "91", "72", "92");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "89", "65", "90");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "87", "60", "75");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "85", "55", "68");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "86", "73", "80");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "88", "78", "65");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "84", "69", "72");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "90", "71", "74");
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");