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,
"date" TEXT,
"overall_rating" INT,
"penalties" 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", "Neymar Jr", "5003", "1992-02-05");
INSERT INTO "Player" VALUES ("4", "1004", "Kylian Mbappe", "5004", "1998-12-20");
INSERT INTO "Player" VALUES ("5", "1005", "Robert Lewandowski", "5005", "1988-08-21");
INSERT INTO "Player" VALUES ("6", "1006", "Sergio Ramos", "5006", "1986-03-30");
INSERT INTO "Player" VALUES ("7", "1007", "Kevin De Bruyne", "5007", "1991-06-28");
INSERT INTO "Player" VALUES ("8", "1008", "Mohamed Salah", "5008", "1992-06-15");
INSERT INTO "Player" VALUES ("9", "1009", "Eden Hazard", "5009", "1991-01-07");
INSERT INTO "Player" VALUES ("10", "1010", "Harry Kane", "5010", "1993-07-28");
INSERT INTO "Player" VALUES ("11", "1011", "Luis Suarez", "5011", "1987-01-24");
INSERT INTO "Player" VALUES ("12", "1012", "Zlatan Ibrahimovic", "5012", "1981-10-03");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "2020-01-01", "94", "5");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "2020-01-01", "93", "7");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "2020-01-01", "91", "6");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "2020-01-01", "90", "4");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "2020-01-01", "92", "8");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "2020-01-01", "89", "3");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "2020-01-01", "88", "2");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "2020-01-01", "87", "1");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "2020-01-01", "86", "0");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "2020-01-01", "85", "4");
INSERT INTO "Player_Attributes" VALUES ("11", "1011", "2020-01-01", "84", "7");
INSERT INTO "Player_Attributes" VALUES ("12", "1012", "2020-01-01", "83", "8");
INSERT INTO "Player_Attributes" VALUES ("13", "1005", "2019-06-01", "90", "8");
INSERT INTO "Player_Attributes" VALUES ("14", "1012", "2019-06-01", "82", "8");
INSERT INTO "Player_Attributes" VALUES ("15", "1002", "2019-06-01", "91", "7");
INSERT INTO "Player_Attributes" VALUES ("16", "1011", "2019-06-01", "83", "7");