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

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



INSERT INTO "Player" VALUES ("1", "1001", "Kevin Constant", "1987-05-10", "180");
INSERT INTO "Player" VALUES ("2", "1002", "John Smith", "1990-07-15", "175");
INSERT INTO "Player" VALUES ("3", "1003", "Alex Johnson", "1985-03-22", "182");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "2010-01-01", "70", "60");
INSERT INTO "Player_Attributes" VALUES ("2", "1001", "2011-06-15", "72", "65");
INSERT INTO "Player_Attributes" VALUES ("3", "1001", "2012-08-20", "75", "70");
INSERT INTO "Player_Attributes" VALUES ("4", "1001", "2013-05-10", "74", "70");
INSERT INTO "Player_Attributes" VALUES ("5", "1001", "2014-09-30", "76", "68");
INSERT INTO "Player_Attributes" VALUES ("6", "1002", "2010-01-01", "65", "55");
INSERT INTO "Player_Attributes" VALUES ("7", "1002", "2011-06-15", "67", "58");
INSERT INTO "Player_Attributes" VALUES ("8", "1003", "2010-01-01", "80", "75");
INSERT INTO "Player_Attributes" VALUES ("9", "1003", "2011-06-15", "82", "78");