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", "Cristiano Ronaldo", "5001", "1985-02-05");
INSERT INTO "Player" VALUES ("2", "1002", "Lionel Messi", "5002", "1987-06-24");
INSERT INTO "Player" VALUES ("3", "1003", "Neymar Jr", "5003", "1992-02-05");
INSERT INTO "Player" VALUES ("4", "1004", "Kylian Mbappe", "5004", "1998-12-20");
INSERT INTO "Player" VALUES ("5", "1005", "Luka Modric", "5005", "1985-09-09");
INSERT INTO "Player" VALUES ("6", "1006", "Zlatan Ibrahimovic", "5006", "1981-10-03");
INSERT INTO "Player" VALUES ("7", "1007", "Robert Lewandowski", "5007", "1988-08-21");
INSERT INTO "Player" VALUES ("8", "1008", "Kevin De Bruyne", "5008", "1991-06-28");
INSERT INTO "Player" VALUES ("9", "1009", "Sergio Ramos", "5009", "1986-03-30");
INSERT INTO "Player" VALUES ("10", "1010", "Virgil van Dijk", "5010", "1991-07-08");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "94", "95");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "95", "96");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "92", "94");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "91", "93");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "89", "90");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "88", "89");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "90", "91");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "89", "90");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "87", "88");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "86", "87");