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,
"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", "1001", "Player A", "2001", "1985-01-15", "180", "75");
INSERT INTO "Player" VALUES ("2", "1002", "Player B", "2002", "1987-03-20", "175", "70");
INSERT INTO "Player" VALUES ("3", "1003", "Player C", "2003", "1984-11-01", "185", "80");
INSERT INTO "Player" VALUES ("4", "1004", "Player D", "2004", "1986-07-10", "178", "72");
INSERT INTO "Player" VALUES ("5", "1005", "Player E", "2005", "1983-05-25", "170", "68");
INSERT INTO "Player" VALUES ("6", "1006", "Player F", "2006", "1988-09-05", "190", "85");
INSERT INTO "Player" VALUES ("7", "1007", "Player G", "2007", "1985-12-31", "182", "77");
INSERT INTO "Player" VALUES ("8", "1008", "Player H", "2008", "1986-01-01", "176", "71");
INSERT INTO "Player" VALUES ("9", "1009", "Player I", "2009", "1982-02-29", "188", "82");
INSERT INTO "Player" VALUES ("10", "1010", "Player J", "2010", "1987-04-12", "173", "69");
INSERT INTO "Player_Attributes" VALUES ("1", "2001", "1001", "85");
INSERT INTO "Player_Attributes" VALUES ("2", "2002", "1002", "78");
INSERT INTO "Player_Attributes" VALUES ("3", "2003", "1003", "90");
INSERT INTO "Player_Attributes" VALUES ("4", "2004", "1004", "82");
INSERT INTO "Player_Attributes" VALUES ("5", "2005", "1005", "88");
INSERT INTO "Player_Attributes" VALUES ("6", "2006", "1006", "75");
INSERT INTO "Player_Attributes" VALUES ("7", "2007", "1007", "86");
INSERT INTO "Player_Attributes" VALUES ("8", "2008", "1008", "80");
INSERT INTO "Player_Attributes" VALUES ("9", "2009", "1009", "92");
INSERT INTO "Player_Attributes" VALUES ("10", "2010", "1010", "76");
INSERT INTO "Player_Attributes" VALUES ("11", "2001", "1001", "84");
INSERT INTO "Player_Attributes" VALUES ("12", "2003", "1003", "89");
INSERT INTO "Player_Attributes" VALUES ("13", "2005", "1005", "87");
INSERT INTO "Player_Attributes" VALUES ("14", "2007", "1007", "85");
INSERT INTO "Player_Attributes" VALUES ("15", "2009", "1009", "91");