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

CREATE TABLE "League" (
"id" INT UNIQUE,
"country_id" INT,
"name" TEXT,
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")
);



INSERT INTO "Country" VALUES ("1", "England");
INSERT INTO "Country" VALUES ("2", "Spain");
INSERT INTO "Country" VALUES ("3", "Germany");
INSERT INTO "Country" VALUES ("4", "Italy");
INSERT INTO "Country" VALUES ("5", "France");
INSERT INTO "League" VALUES ("10", "1", "Premier League");
INSERT INTO "League" VALUES ("20", "2", "La Liga");
INSERT INTO "League" VALUES ("30", "3", "Bundesliga");
INSERT INTO "League" VALUES ("40", "4", "Serie A");
INSERT INTO "League" VALUES ("50", "5", "Ligue 1");
INSERT INTO "Match" VALUES ("1001", "1", "10");
INSERT INTO "Match" VALUES ("1002", "1", "10");
INSERT INTO "Match" VALUES ("1003", "1", "10");
INSERT INTO "Match" VALUES ("1004", "1", "10");
INSERT INTO "Match" VALUES ("1005", "1", "10");
INSERT INTO "Match" VALUES ("1006", "1", "10");
INSERT INTO "Match" VALUES ("1007", "1", "10");
INSERT INTO "Match" VALUES ("1008", "1", "10");
INSERT INTO "Match" VALUES ("1009", "1", "10");
INSERT INTO "Match" VALUES ("1010", "1", "10");
INSERT INTO "Match" VALUES ("1011", "1", "10");
INSERT INTO "Match" VALUES ("1012", "1", "10");
INSERT INTO "Match" VALUES ("1013", "1", "10");
INSERT INTO "Match" VALUES ("1014", "1", "10");
INSERT INTO "Match" VALUES ("1015", "1", "10");
INSERT INTO "Match" VALUES ("2001", "2", "20");
INSERT INTO "Match" VALUES ("2002", "2", "20");
INSERT INTO "Match" VALUES ("2003", "2", "20");
INSERT INTO "Match" VALUES ("2004", "2", "20");
INSERT INTO "Match" VALUES ("2005", "2", "20");
INSERT INTO "Match" VALUES ("2006", "2", "20");
INSERT INTO "Match" VALUES ("2007", "2", "20");
INSERT INTO "Match" VALUES ("2008", "2", "20");
INSERT INTO "Match" VALUES ("2009", "2", "20");
INSERT INTO "Match" VALUES ("2010", "2", "20");
INSERT INTO "Match" VALUES ("3001", "3", "30");
INSERT INTO "Match" VALUES ("3002", "3", "30");
INSERT INTO "Match" VALUES ("3003", "3", "30");
INSERT INTO "Match" VALUES ("3004", "3", "30");
INSERT INTO "Match" VALUES ("3005", "3", "30");
INSERT INTO "Match" VALUES ("3006", "3", "30");
INSERT INTO "Match" VALUES ("3007", "3", "30");
INSERT INTO "Match" VALUES ("4001", "4", "40");
INSERT INTO "Match" VALUES ("4002", "4", "40");
INSERT INTO "Match" VALUES ("4003", "4", "40");
INSERT INTO "Match" VALUES ("4004", "4", "40");
INSERT INTO "Match" VALUES ("4005", "4", "40");
INSERT INTO "Match" VALUES ("5001", "5", "50");
INSERT INTO "Match" VALUES ("5002", "5", "50");
INSERT INTO "Match" VALUES ("5003", "5", "50");