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_team_api_id" INT,
PRIMARY KEY ("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,
"date" TEXT,
"overall_rating" INT,
"sprint_speed" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id")
);



INSERT INTO "Match" VALUES ("1", "1001");
INSERT INTO "Match" VALUES ("2", "1002");
INSERT INTO "Match" VALUES ("3", "1003");
INSERT INTO "Player" VALUES ("1", "1001", "1990-05-20", "180");
INSERT INTO "Player" VALUES ("2", "1002", "1985-12-15", "175");
INSERT INTO "Player" VALUES ("3", "1003", "2000-07-10", "185");
INSERT INTO "Player" VALUES ("4", "1004", "1995-03-30", "178");
INSERT INTO "Player" VALUES ("5", "1005", "1998-11-25", "182");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "2013-06-15", "85", "97");
INSERT INTO "Player_Attributes" VALUES ("2", "1001", "2014-07-20", "88", "98");
INSERT INTO "Player_Attributes" VALUES ("3", "1002", "2013-05-10", "90", "96");
INSERT INTO "Player_Attributes" VALUES ("4", "1002", "2015-08-25", "91", "97");
INSERT INTO "Player_Attributes" VALUES ("5", "1003", "2014-09-30", "80", "99");
INSERT INTO "Player_Attributes" VALUES ("6", "1004", "2012-11-11", "75", "97");
INSERT INTO "Player_Attributes" VALUES ("7", "1004", "2013-01-01", "78", "97");
INSERT INTO "Player_Attributes" VALUES ("8", "1005", "2015-12-31", "82", "100");
INSERT INTO "Player_Attributes" VALUES ("9", "1005", "2016-01-01", "83", "98");