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 "Player" (
"id" INT,
"player_api_id" INT UNIQUE,
"player_name" TEXT,
"player_fifa_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 "Player" VALUES ("1", "1001", "Dorlan Pabon", "5001", "1988-01-08");
INSERT INTO "Player" VALUES ("2", "1002", "Lionel Messi", "5002", "1987-06-24");
INSERT INTO "Player" VALUES ("3", "1003", "Cristiano Ronaldo", "5003", "1985-02-05");
INSERT INTO "Player" VALUES ("4", "1004", "Neymar Jr", "5004", "1992-02-05");
INSERT INTO "Player" VALUES ("5", "1005", "Kylian Mbappe", "5005", "1998-12-20");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "82", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "1001", "85", "87");
INSERT INTO "Player_Attributes" VALUES ("3", "1001", "83", "86");
INSERT INTO "Player_Attributes" VALUES ("4", "1002", "94", "95");
INSERT INTO "Player_Attributes" VALUES ("5", "1002", "95", "96");
INSERT INTO "Player_Attributes" VALUES ("6", "1003", "93", "94");
INSERT INTO "Player_Attributes" VALUES ("7", "1003", "92", "93");
INSERT INTO "Player_Attributes" VALUES ("8", "1004", "91", "92");
INSERT INTO "Player_Attributes" VALUES ("9", "1005", "89", "93");
INSERT INTO "Player_Attributes" VALUES ("10", "1005", "90", "94");