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", "1001", "1990-05-21");
INSERT INTO "Player" VALUES ("2", "1002", "1988-11-12");
INSERT INTO "Player" VALUES ("3", "1003", "1995-07-30");
INSERT INTO "Player" VALUES ("4", "1004", "1992-03-15");
INSERT INTO "Player" VALUES ("5", "1005", "1991-09-09");
INSERT INTO "Player" VALUES ("6", "1006", "1993-12-01");
INSERT INTO "Player" VALUES ("7", "1007", "1994-06-22");
INSERT INTO "Player" VALUES ("8", "1008", "1989-01-10");
INSERT INTO "Player" VALUES ("9", "1009", "1996-04-05");
INSERT INTO "Player" VALUES ("10", "1010", "1990-08-18");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "60", "50", "right");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "58", "50", "right");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "62", "50", "left");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "59", "50", "right");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "61", "50", "right");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "57", "50", "right");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "55", "51", "right");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "54", "52", "left");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "56", "53", "right");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "53", "54", "right");