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

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



INSERT INTO "Player" VALUES ("1", "1001", "190", "85");
INSERT INTO "Player" VALUES ("2", "1002", "160", "60");
INSERT INTO "Player" VALUES ("3", "1003", "175", "70");
INSERT INTO "Player" VALUES ("4", "1004", "190", "90");
INSERT INTO "Player" VALUES ("5", "1005", "160", "62");
INSERT INTO "Player" VALUES ("6", "1006", "180", "75");
INSERT INTO "Player" VALUES ("7", "1007", "170", "68");
INSERT INTO "Player" VALUES ("8", "1008", "195", "92");
INSERT INTO "Player" VALUES ("9", "1009", "155", "58");
INSERT INTO "Player" VALUES ("10", "1010", "185", "80");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "85", "78");
INSERT INTO "Player_Attributes" VALUES ("2", "1001", "86", "80");
INSERT INTO "Player_Attributes" VALUES ("3", "1002", "70", "65");
INSERT INTO "Player_Attributes" VALUES ("4", "1002", "72", "68");
INSERT INTO "Player_Attributes" VALUES ("5", "1003", "80", "75");
INSERT INTO "Player_Attributes" VALUES ("6", "1004", "88", "82");
INSERT INTO "Player_Attributes" VALUES ("7", "1004", "89", "85");
INSERT INTO "Player_Attributes" VALUES ("8", "1005", "71", "66");
INSERT INTO "Player_Attributes" VALUES ("9", "1005", "73", "69");
INSERT INTO "Player_Attributes" VALUES ("10", "1006", "78", "72");
INSERT INTO "Player_Attributes" VALUES ("11", "1007", "75", "70");
INSERT INTO "Player_Attributes" VALUES ("12", "1008", "90", "88");
INSERT INTO "Player_Attributes" VALUES ("13", "1008", "91", "89");
INSERT INTO "Player_Attributes" VALUES ("14", "1009", "68", "60");
INSERT INTO "Player_Attributes" VALUES ("15", "1009", "69", "62");
INSERT INTO "Player_Attributes" VALUES ("16", "1010", "82", "77");
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");