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,
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", "5001", "1990-05-21");
INSERT INTO "Player" VALUES ("2", "5002", "1988-11-12");
INSERT INTO "Player" VALUES ("3", "5003", "1995-07-30");
INSERT INTO "Player" VALUES ("4", "5004", "1992-03-15");
INSERT INTO "Player" VALUES ("5", "5005", "1991-12-01");
INSERT INTO "Player_Attributes" VALUES ("1", "5001", "85", "90");
INSERT INTO "Player_Attributes" VALUES ("2", "5002", "88", "91");
INSERT INTO "Player_Attributes" VALUES ("3", "5003", "90", "92");
INSERT INTO "Player_Attributes" VALUES ("4", "5004", "90", "93");
INSERT INTO "Player_Attributes" VALUES ("5", "5005", "87", "89");