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,
"height" INT,
"weight" INT,
PRIMARY KEY ("id")
);

CREATE TABLE "Player_Attributes" (
"id" INT,
"player_fifa_api_id" INT,
"player_api_id" INT,
"date" TEXT,
"overall_rating" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id"),
FOREIGN KEY ("player_fifa_api_id") REFERENCES "Player"("player_fifa_api_id")
);



INSERT INTO "Player" VALUES ("1", "12345", "Landon Donovan", "54321", "1982-03-04", "173", "72");
INSERT INTO "Player" VALUES ("2", "67890", "Jordan Bowery", "98765", "1991-07-02", "188", "80");
INSERT INTO "Player" VALUES ("3", "11223", "Lionel Messi", "33445", "1987-06-24", "170", "72");
INSERT INTO "Player" VALUES ("4", "44556", "Cristiano Ronaldo", "66778", "1985-02-05", "187", "83");
INSERT INTO "Player" VALUES ("5", "77889", "Neymar Jr", "11223", "1992-02-05", "175", "68");
INSERT INTO "Player_Attributes" VALUES ("1", "54321", "12345", "2013-07-12", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "98765", "67890", "2013-07-12", "70");
INSERT INTO "Player_Attributes" VALUES ("3", "54321", "12345", "2014-01-01", "86");
INSERT INTO "Player_Attributes" VALUES ("4", "98765", "67890", "2014-01-01", "71");
INSERT INTO "Player_Attributes" VALUES ("5", "33445", "11223", "2013-07-12", "95");
INSERT INTO "Player_Attributes" VALUES ("6", "66778", "44556", "2013-07-12", "94");
INSERT INTO "Player_Attributes" VALUES ("7", "54321", "12345", "2012-07-12", "84");
INSERT INTO "Player_Attributes" VALUES ("8", "98765", "67890", "2012-07-12", "68");
INSERT INTO "Player_Attributes" VALUES ("9", "54321", "12345", "2013-07-13", "85");
INSERT INTO "Player_Attributes" VALUES ("10", "98765", "67890", "2013-07-13", "70");