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

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



INSERT INTO "Player" VALUES ("1", "1001", "John Tallman", "5001", "200", "90");
INSERT INTO "Player" VALUES ("2", "1002", "Mike Shorty", "5002", "160", "75");
INSERT INTO "Player" VALUES ("3", "1003", "Alex Average", "5003", "180", "80");
INSERT INTO "Player" VALUES ("4", "1004", "Chris Medium", "5004", "190", "85");
INSERT INTO "Player" VALUES ("5", "1005", "Sam Tiny", "5005", "160", "70");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "85", "70");
INSERT INTO "Player_Attributes" VALUES ("2", "1001", "88", "75");
INSERT INTO "Player_Attributes" VALUES ("3", "1002", "80", "90");
INSERT INTO "Player_Attributes" VALUES ("4", "1002", "82", "95");
INSERT INTO "Player_Attributes" VALUES ("5", "1003", "78", "60");
INSERT INTO "Player_Attributes" VALUES ("6", "1003", "79", "65");
INSERT INTO "Player_Attributes" VALUES ("7", "1004", "83", "50");
INSERT INTO "Player_Attributes" VALUES ("8", "1004", "85", "55");
INSERT INTO "Player_Attributes" VALUES ("9", "1005", "77", "92");
INSERT INTO "Player_Attributes" VALUES ("10", "1005", "76", "88");