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

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



INSERT INTO "Player" VALUES ("1", "1001", "Player A", "175");
INSERT INTO "Player" VALUES ("2", "1002", "Player B", "185");
INSERT INTO "Player" VALUES ("3", "1003", "Player C", "170");
INSERT INTO "Player" VALUES ("4", "1004", "Player D", "190");
INSERT INTO "Player" VALUES ("5", "1005", "Player E", "178");
INSERT INTO "Player" VALUES ("6", "1006", "Player F", "165");
INSERT INTO "Player" VALUES ("7", "1007", "Player G", "180");
INSERT INTO "Player" VALUES ("8", "1008", "Player H", "172");
INSERT INTO "Player" VALUES ("9", "1009", "Player I", "195");
INSERT INTO "Player" VALUES ("10", "1010", "Player J", "179");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "75", "80");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "65", "70");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "80", "85");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "72", "78");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "68", "75");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "78", "82");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "70", "75");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "85", "90");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "60", "65");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "73", "77");
INSERT INTO "Match" VALUES ("1", "1001");
INSERT INTO "Match" VALUES ("2", "1003");
INSERT INTO "Match" VALUES ("3", "1005");
INSERT INTO "Match" VALUES ("4", "1008");
INSERT INTO "Match" VALUES ("5", "1010");