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", "Lionel Messi", "5001", "1987-06-24");
INSERT INTO "Player" VALUES ("2", "1002", "Cristiano Ronaldo", "5002", "1985-02-05");
INSERT INTO "Player" VALUES ("3", "1003", "Kylian Mbappe", "5003", "1998-12-20");
INSERT INTO "Player" VALUES ("4", "1004", "Erling Haaland", "5004", "2000-07-21");
INSERT INTO "Player" VALUES ("5", "1005", "Neymar Jr", "5005", "1992-02-05");
INSERT INTO "Player" VALUES ("6", "1006", "Young Talent A", "5006", "2005-03-15");
INSERT INTO "Player" VALUES ("7", "1007", "Young Talent B", "5007", "2006-08-30");
INSERT INTO "Player" VALUES ("8", "1008", "Veteran Player", "5008", "1980-11-11");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "93", "94");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "92", "93");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "89", "95");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "88", "95");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "91", "92");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "70", "99");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "68", "99");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "65", "80");