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_fifa_api_id" INT,
"player_api_id" INT,
"finishing" INT,
"short_passing" INT,
"dribbling" INT,
"curve" 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", "John Smith", "5001", "180", "75");
INSERT INTO "Player" VALUES ("2", "1002", "Alex Johnson", "5002", "175", "85");
INSERT INTO "Player" VALUES ("3", "1003", "Michael Brown", "5003", "185", "90");
INSERT INTO "Player" VALUES ("4", "1004", "Chris Davis", "5004", "178", "90");
INSERT INTO "Player" VALUES ("5", "1005", "David Wilson", "5005", "182", "88");
INSERT INTO "Player_Attributes" VALUES ("1", "5001", "1001", "70", "75", "80", "65");
INSERT INTO "Player_Attributes" VALUES ("2", "5002", "1002", "85", "80", "78", "70");
INSERT INTO "Player_Attributes" VALUES ("3", "5003", "1003", "90", "85", "88", "75");
INSERT INTO "Player_Attributes" VALUES ("4", "5004", "1004", "60", "70", "65", "60");
INSERT INTO "Player_Attributes" VALUES ("5", "5005", "1005", "88", "82", "85", "80");