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,
"away_player_1" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("away_player_1") 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,
"player_api_id" INT,
"crossing" INT,
"long_passing" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_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", "Kevin De Bruyne");
INSERT INTO "Player" VALUES ("5", "1005", "Luka Modric");
INSERT INTO "Player" VALUES ("6", "1006", "Trent Alexander-Arnold");
INSERT INTO "Player" VALUES ("7", "1007", "Joshua Kimmich");
INSERT INTO "Player" VALUES ("8", "1008", "Andrew Robertson");
INSERT INTO "Player" VALUES ("9", "1009", "Kylian Mbappe");
INSERT INTO "Player" VALUES ("10", "1010", "Virgil van Dijk");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "85", "80");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "78", "75");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "82", "79");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "92", "90");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "88", "91");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "95", "89");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "90", "92");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "93", "87");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "75", "70");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "60", "85");
INSERT INTO "Player_Attributes" VALUES ("11", "1001", "86", "81");
INSERT INTO "Player_Attributes" VALUES ("12", "1004", "93", "91");
INSERT INTO "Player_Attributes" VALUES ("13", "1006", "96", "90");
INSERT INTO "Player_Attributes" VALUES ("14", "1007", "91", "93");
INSERT INTO "Player_Attributes" VALUES ("15", "1008", "94", "88");
INSERT INTO "Match" VALUES ("1", "1001", "1002");
INSERT INTO "Match" VALUES ("2", "1003", "1004");
INSERT INTO "Match" VALUES ("3", "1005", "1006");
INSERT INTO "Match" VALUES ("4", "1007", "1008");
INSERT INTO "Match" VALUES ("5", "1009", "1010");
INSERT INTO "Match" VALUES ("6", "1001", "1004");
INSERT INTO "Match" VALUES ("7", "1006", "1007");