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,
"player_fifa_api_id" INT UNIQUE,
PRIMARY KEY ("id")
);

CREATE TABLE "Player_Attributes" (
"id" INT,
"player_fifa_api_id" INT,
"player_api_id" INT,
"overall_rating" INT,
"attacking_work_rate" TEXT,
"defensive_work_rate" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("player_fifa_api_id") REFERENCES "Player"("player_fifa_api_id")
);



INSERT INTO "Player" VALUES ("1", "1001", "Franco Zennaro", "2001");
INSERT INTO "Player" VALUES ("2", "1002", "Lionel Messi", "2002");
INSERT INTO "Player" VALUES ("3", "1003", "Cristiano Ronaldo", "2003");
INSERT INTO "Player" VALUES ("4", "1004", "Neymar Jr.", "2004");
INSERT INTO "Player" VALUES ("5", "1005", "Kylian Mbappe", "2005");
INSERT INTO "Player" VALUES ("6", "1006", "Robert Lewandowski", "2006");
INSERT INTO "Player" VALUES ("7", "1007", "Kevin De Bruyne", "2007");
INSERT INTO "Player" VALUES ("8", "1008", "Sergio Ramos", "2008");
INSERT INTO "Player" VALUES ("9", "1009", "Virgil van Dijk", "2009");
INSERT INTO "Player" VALUES ("10", "1010", "Manuel Neuer", "2010");
INSERT INTO "Player_Attributes" VALUES ("1", "2001", "1001", "75", "High", "Medium");
INSERT INTO "Player_Attributes" VALUES ("2", "2002", "1002", "93", "High", "Low");
INSERT INTO "Player_Attributes" VALUES ("3", "2003", "1003", "92", "High", "Low");
INSERT INTO "Player_Attributes" VALUES ("4", "2004", "1004", "91", "High", "Medium");
INSERT INTO "Player_Attributes" VALUES ("5", "2005", "1005", "90", "High", "Medium");
INSERT INTO "Player_Attributes" VALUES ("6", "2006", "1006", "89", "High", "Medium");
INSERT INTO "Player_Attributes" VALUES ("7", "2007", "1007", "91", "High", "High");
INSERT INTO "Player_Attributes" VALUES ("8", "2008", "1008", "88", "Medium", "High");
INSERT INTO "Player_Attributes" VALUES ("9", "2009", "1009", "90", "Low", "High");
INSERT INTO "Player_Attributes" VALUES ("10", "2010", "1010", "89", "Low", "Medium");
INSERT INTO "Player_Attributes" VALUES ("11", "2001", "1001", "76", "Medium", "Medium");
INSERT INTO "Player_Attributes" VALUES ("12", "2001", "1001", "74", "Low", "Medium");
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");