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

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



INSERT INTO "Player" VALUES ("1", "1001", "1980-05-12", "180");
INSERT INTO "Player" VALUES ("2", "1002", "1985-11-23", "175");
INSERT INTO "Player" VALUES ("3", "1003", "1987-07-30", "178");
INSERT INTO "Player" VALUES ("4", "1004", "1983-01-15", "182");
INSERT INTO "Player" VALUES ("5", "1005", "1979-12-05", "185");
INSERT INTO "Player" VALUES ("6", "1006", "1984-09-09", "177");
INSERT INTO "Player" VALUES ("7", "1007", "1986-02-20", "180");
INSERT INTO "Player" VALUES ("8", "1008", "1982-04-18", "174");
INSERT INTO "Player" VALUES ("9", "1009", "1981-08-25", "179");
INSERT INTO "Player" VALUES ("10", "1010", "1988-03-10", "176");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "85", "high");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "78", "medium");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "80", "low");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "82", "high");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "88", "high");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "75", "medium");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "79", "high");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "77", "high");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "83", "low");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "76", "medium");
INSERT INTO "Match" VALUES ("1", "1001");
INSERT INTO "Match" VALUES ("2", "1002");
INSERT INTO "Match" VALUES ("3", "1004");
INSERT INTO "Match" VALUES ("4", "1005");
INSERT INTO "Match" VALUES ("5", "1006");
INSERT INTO "Match" VALUES ("6", "1008");
INSERT INTO "Match" VALUES ("7", "1009");