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,
"potential" INT,
"balance" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("player_api_id") REFERENCES "Player"("player_api_id")
);



INSERT INTO "Player" VALUES ("1", "1001", "John Smith", "1990-05-12", "180");
INSERT INTO "Player" VALUES ("2", "1002", "Alex Johnson", "1988-11-23", "175");
INSERT INTO "Player" VALUES ("3", "1003", "Michael Brown", "1992-07-30", "182");
INSERT INTO "Player" VALUES ("4", "1004", "Chris Davis", "1991-01-15", "178");
INSERT INTO "Player" VALUES ("5", "1005", "David Wilson", "1989-09-05", "185");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "2020-01-01", "75", "61", "50");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "2020-01-01", "80", "61", "70");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "2020-01-01", "78", "61", "70");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "2020-01-01", "82", "62", "65");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "2020-01-01", "77", "60", "70");
INSERT INTO "Player_Attributes" VALUES ("6", "1001", "2021-01-01", "76", "61", "70");
INSERT INTO "Player_Attributes" VALUES ("7", "1002", "2021-01-01", "81", "61", "68");
INSERT INTO "Player_Attributes" VALUES ("8", "1003", "2021-01-01", "79", "61", "70");
INSERT INTO "Player_Attributes" VALUES ("9", "1004", "2021-01-01", "83", "62", "66");
INSERT INTO "Player_Attributes" VALUES ("10", "1005", "2021-01-01", "78", "60", "69");