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 "Match" (
"id" INT,
"home_team_api_id" INT,
"away_team_api_id" INT,
PRIMARY KEY ("id")
);

CREATE TABLE "Player" (
"id" INT,
"player_api_id" INT UNIQUE,
"player_name" TEXT,
PRIMARY KEY ("id")
);

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



INSERT INTO "Player" VALUES ("1", "1001", "Lionel Messi");
INSERT INTO "Player" VALUES ("2", "1002", "Cristiano Ronaldo");
INSERT INTO "Player" VALUES ("3", "1003", "Neymar Jr.");
INSERT INTO "Player" VALUES ("4", "1004", "Kevin De Bruyne");
INSERT INTO "Player" VALUES ("5", "1005", "Sergio Ramos");
INSERT INTO "Player" VALUES ("6", "1006", "Virgil van Dijk");
INSERT INTO "Player" VALUES ("7", "1007", "Robert Lewandowski");
INSERT INTO "Player" VALUES ("8", "1008", "Kylian Mbappé");
INSERT INTO "Player" VALUES ("9", "1009", "Luka Modric");
INSERT INTO "Player" VALUES ("10", "1010", "Manuel Neuer");
INSERT INTO "Player_Attributes" VALUES ("1", "1001", "94", "high");
INSERT INTO "Player_Attributes" VALUES ("2", "1002", "93", "high");
INSERT INTO "Player_Attributes" VALUES ("3", "1003", "92", "high");
INSERT INTO "Player_Attributes" VALUES ("4", "1004", "91", "high");
INSERT INTO "Player_Attributes" VALUES ("5", "1005", "89", "medium");
INSERT INTO "Player_Attributes" VALUES ("6", "1006", "90", "low");
INSERT INTO "Player_Attributes" VALUES ("7", "1007", "91", "high");
INSERT INTO "Player_Attributes" VALUES ("8", "1008", "91", "high");
INSERT INTO "Player_Attributes" VALUES ("9", "1009", "88", "medium");
INSERT INTO "Player_Attributes" VALUES ("10", "1010", "90", "low");
INSERT INTO "Player_Attributes" VALUES ("11", "1001", "95", "high");
INSERT INTO "Player_Attributes" VALUES ("12", "1002", "94", "high");
INSERT INTO "Player_Attributes" VALUES ("13", "1005", "88", "high");
INSERT INTO "Player_Attributes" VALUES ("14", "1006", "89", "high");
INSERT INTO "Player_Attributes" VALUES ("15", "1009", "87", "high");
INSERT INTO "Match" VALUES ("1", "100", "200");
INSERT INTO "Match" VALUES ("2", "100", "300");
INSERT INTO "Match" VALUES ("3", "200", "100");
INSERT INTO "Match" VALUES ("4", "300", "400");
INSERT INTO "Match" VALUES ("5", "400", "100");