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 "Country" (
"id" INT UNIQUE,
"name" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "Match" (
"id" INT,
"country_id" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("country_id") REFERENCES "Country"("id")
);

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

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



INSERT INTO "Country" VALUES ("1", "Belgium");
INSERT INTO "Country" VALUES ("2", "France");
INSERT INTO "Country" VALUES ("3", "Germany");
INSERT INTO "Country" VALUES ("4", "Netherlands");
INSERT INTO "Match" VALUES ("101", "1");
INSERT INTO "Match" VALUES ("102", "2");
INSERT INTO "Match" VALUES ("103", "3");
INSERT INTO "Match" VALUES ("104", "1");
INSERT INTO "Match" VALUES ("105", "4");
INSERT INTO "Player" VALUES ("201", "5001", "Kevin De Bruyne", "10001");
INSERT INTO "Player" VALUES ("202", "5002", "Eden Hazard", "10002");
INSERT INTO "Player" VALUES ("203", "5003", "Kylian Mbappe", "10003");
INSERT INTO "Player" VALUES ("204", "5004", "Toni Kroos", "10004");
INSERT INTO "Player" VALUES ("205", "5005", "Virgil van Dijk", "10005");
INSERT INTO "Player" VALUES ("206", "5006", "Romelu Lukaku", "10006");
INSERT INTO "Player" VALUES ("207", "5007", "Thibaut Courtois", "10007");
INSERT INTO "Player_Attributes" VALUES ("301", "5001");
INSERT INTO "Player_Attributes" VALUES ("302", "5002");
INSERT INTO "Player_Attributes" VALUES ("303", "5003");
INSERT INTO "Player_Attributes" VALUES ("304", "5004");
INSERT INTO "Player_Attributes" VALUES ("305", "5005");
INSERT INTO "Player_Attributes" VALUES ("306", "5006");
INSERT INTO "Player_Attributes" VALUES ("307", "5007");