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

CREATE TABLE "Player_Attributes" (
"id" INT,
"player_api_id" INT,
"overall_rating" INT,
"potential" INT,
"preferred_foot" TEXT,
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", "2001", "1990-05-15");
INSERT INTO "Player" VALUES ("2", "2002", "1988-11-23");
INSERT INTO "Player" VALUES ("3", "2003", "1995-07-30");
INSERT INTO "Player" VALUES ("4", "2004", "1992-01-10");
INSERT INTO "Player" VALUES ("5", "2005", "1993-03-25");
INSERT INTO "Player" VALUES ("6", "2006", "1991-12-05");
INSERT INTO "Player" VALUES ("7", "2007", "1989-08-17");
INSERT INTO "Player" VALUES ("8", "2008", "1994-09-09");
INSERT INTO "Player" VALUES ("9", "2009", "1996-06-20");
INSERT INTO "Player" VALUES ("10", "2010", "1990-02-14");
INSERT INTO "Player_Attributes" VALUES ("1", "2001", "75", "50", "right");
INSERT INTO "Player_Attributes" VALUES ("2", "2002", "80", "60", "left");
INSERT INTO "Player_Attributes" VALUES ("3", "2003", "65", "40", "right");
INSERT INTO "Player_Attributes" VALUES ("4", "2004", "70", "40", "right");
INSERT INTO "Player_Attributes" VALUES ("5", "2005", "60", "40", "right");
INSERT INTO "Player_Attributes" VALUES ("6", "2006", "55", "40", "right");
INSERT INTO "Player_Attributes" VALUES ("7", "2007", "50", "40", "left");
INSERT INTO "Player_Attributes" VALUES ("8", "2008", "45", "45", "right");
INSERT INTO "Player_Attributes" VALUES ("9", "2009", "40", "40", "right");
INSERT INTO "Player_Attributes" VALUES ("10", "2010", "35", "55", "right");