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

CREATE TABLE "Player_Attributes" (
"id" INT,
"player_api_id" INT,
"date" TEXT,
"overall_rating" INT,
"potential" 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", "John Smith", "1985-04-12");
INSERT INTO "Player" VALUES ("2", "1002", "Carlos Mendez", "1990-11-23");
INSERT INTO "Player" VALUES ("3", "1003", "Luca Bianchi", "1988-07-05");
INSERT INTO "Player" VALUES ("4", "1004", "Oliver Jones", "1992-02-17");
INSERT INTO "Player" VALUES ("5", "1005", "Maxim Ivanov", "1983-09-30");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "2007-12-15", "79", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "1001", "2008-06-20", "81", "86");
INSERT INTO "Player_Attributes" VALUES ("3", "1001", "2010-11-10", "82", "87");
INSERT INTO "Player_Attributes" VALUES ("4", "1002", "2008-03-05", "78", "80");
INSERT INTO "Player_Attributes" VALUES ("5", "1002", "2009-08-15", "83", "85");
INSERT INTO "Player_Attributes" VALUES ("6", "1003", "2009-01-25", "80", "82");
INSERT INTO "Player_Attributes" VALUES ("7", "1003", "2010-05-30", "79", "81");
INSERT INTO "Player_Attributes" VALUES ("8", "1004", "2009-07-12", "85", "88");
INSERT INTO "Player_Attributes" VALUES ("9", "1004", "2011-04-20", "87", "89");
INSERT INTO "Player_Attributes" VALUES ("10", "1005", "2008-10-10", "75", "78");
INSERT INTO "Player_Attributes" VALUES ("11", "1005", "2009-12-01", "77", "79");
INSERT INTO "Player_Attributes" VALUES ("12", "1005", "2010-09-15", "81", "83");