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

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

CREATE TABLE "Player" (
"id" INT,
"player_api_id" INT UNIQUE,
"height" INT,
"weight" INT,
PRIMARY KEY ("id")
);

CREATE TABLE "Team" (
"id" INT,
"team_api_id" INT UNIQUE,
PRIMARY KEY ("id")
);



INSERT INTO "Country" VALUES ("1", "Spain");
INSERT INTO "Country" VALUES ("2", "Germany");
INSERT INTO "Country" VALUES ("3", "Italy");
INSERT INTO "Country" VALUES ("4", "France");
INSERT INTO "Country" VALUES ("5", "England");
INSERT INTO "League" VALUES ("10", "1");
INSERT INTO "League" VALUES ("20", "2");
INSERT INTO "League" VALUES ("30", "3");
INSERT INTO "League" VALUES ("40", "4");
INSERT INTO "League" VALUES ("50", "5");
INSERT INTO "Match" VALUES ("100", "1", "10");
INSERT INTO "Match" VALUES ("101", "1", "10");
INSERT INTO "Match" VALUES ("102", "2", "20");
INSERT INTO "Match" VALUES ("103", "2", "20");
INSERT INTO "Match" VALUES ("104", "3", "30");
INSERT INTO "Match" VALUES ("105", "3", "30");
INSERT INTO "Match" VALUES ("106", "4", "40");
INSERT INTO "Match" VALUES ("107", "4", "40");
INSERT INTO "Match" VALUES ("108", "5", "50");
INSERT INTO "Match" VALUES ("109", "5", "50");
INSERT INTO "Team" VALUES ("1000", "5000");
INSERT INTO "Team" VALUES ("1001", "5001");
INSERT INTO "Team" VALUES ("1002", "5002");
INSERT INTO "Team" VALUES ("1003", "5003");
INSERT INTO "Team" VALUES ("1004", "5004");
INSERT INTO "Player" VALUES ("1", "10000", "180", "75");
INSERT INTO "Player" VALUES ("2", "10001", "175", "78");
INSERT INTO "Player" VALUES ("3", "10002", "185", "80");
INSERT INTO "Player" VALUES ("4", "10003", "178", "77");
INSERT INTO "Player" VALUES ("5", "10004", "182", "79");
INSERT INTO "Player" VALUES ("6", "20000", "185", "85");
INSERT INTO "Player" VALUES ("7", "20001", "190", "90");
INSERT INTO "Player" VALUES ("8", "20002", "188", "88");
INSERT INTO "Player" VALUES ("9", "20003", "187", "87");
INSERT INTO "Player" VALUES ("10", "20004", "186", "86");
INSERT INTO "Player" VALUES ("11", "30000", "175", "70");
INSERT INTO "Player" VALUES ("12", "30001", "178", "72");
INSERT INTO "Player" VALUES ("13", "30002", "180", "74");
INSERT INTO "Player" VALUES ("14", "30003", "177", "73");
INSERT INTO "Player" VALUES ("15", "30004", "176", "71");
INSERT INTO "Player" VALUES ("16", "40000", "182", "76");
INSERT INTO "Player" VALUES ("17", "40001", "183", "77");
INSERT INTO "Player" VALUES ("18", "40002", "181", "75");
INSERT INTO "Player" VALUES ("19", "40003", "180", "74");
INSERT INTO "Player" VALUES ("20", "40004", "179", "73");
INSERT INTO "Player" VALUES ("21", "50000", "185", "80");
INSERT INTO "Player" VALUES ("22", "50001", "186", "81");
INSERT INTO "Player" VALUES ("23", "50002", "187", "82");
INSERT INTO "Player" VALUES ("24", "50003", "188", "83");
INSERT INTO "Player" VALUES ("25", "50004", "189", "84");