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 ("1", "1", "Premier League");
INSERT INTO "League" VALUES ("2", "2", "La Liga");
INSERT INTO "League" VALUES ("3", "3", "Bundesliga");
INSERT INTO "League" VALUES ("4", "4", "Serie A");
INSERT INTO "League" VALUES ("5", "5", "Ligue 1");
INSERT INTO "League" VALUES ("6", "1", "Championship");
INSERT INTO "League" VALUES ("7", "2", "Segunda Division");
INSERT INTO "League" VALUES ("8", "3", "2. Bundesliga");
INSERT INTO "League" VALUES ("9", "4", "Serie B");
INSERT INTO "League" VALUES ("10", "5", "National");
INSERT INTO "Match" VALUES ("1", "1", "1");
INSERT INTO "Match" VALUES ("2", "1", "1");
INSERT INTO "Match" VALUES ("3", "1", "1");
INSERT INTO "Match" VALUES ("4", "1", "1");
INSERT INTO "Match" VALUES ("5", "1", "1");
INSERT INTO "Match" VALUES ("6", "1", "1");
INSERT INTO "Match" VALUES ("7", "1", "1");
INSERT INTO "Match" VALUES ("8", "1", "1");
INSERT INTO "Match" VALUES ("9", "1", "1");
INSERT INTO "Match" VALUES ("10", "1", "1");
INSERT INTO "Match" VALUES ("11", "2", "2");
INSERT INTO "Match" VALUES ("12", "2", "2");
INSERT INTO "Match" VALUES ("13", "2", "2");
INSERT INTO "Match" VALUES ("14", "2", "2");
INSERT INTO "Match" VALUES ("15", "2", "2");
INSERT INTO "Match" VALUES ("16", "2", "2");
INSERT INTO "Match" VALUES ("17", "2", "2");
INSERT INTO "Match" VALUES ("18", "2", "2");
INSERT INTO "Match" VALUES ("19", "2", "2");
INSERT INTO "Match" VALUES ("20", "2", "2");
INSERT INTO "Match" VALUES ("21", "3", "3");
INSERT INTO "Match" VALUES ("22", "3", "3");
INSERT INTO "Match" VALUES ("23", "3", "3");
INSERT INTO "Match" VALUES ("24", "3", "3");
INSERT INTO "Match" VALUES ("25", "3", "3");
INSERT INTO "Match" VALUES ("26", "3", "3");
INSERT INTO "Match" VALUES ("27", "3", "3");
INSERT INTO "Match" VALUES ("28", "3", "3");
INSERT INTO "Match" VALUES ("29", "4", "4");
INSERT INTO "Match" VALUES ("30", "4", "4");
INSERT INTO "Match" VALUES ("31", "4", "4");
INSERT INTO "Match" VALUES ("32", "4", "4");
INSERT INTO "Match" VALUES ("33", "4", "4");
INSERT INTO "Match" VALUES ("34", "1", "6");
INSERT INTO "Match" VALUES ("35", "1", "6");
INSERT INTO "Match" VALUES ("36", "1", "6");
INSERT INTO "Match" VALUES ("37", "1", "6");
INSERT INTO "Match" VALUES ("38", "1", "6");
INSERT INTO "Match" VALUES ("39", "1", "6");
INSERT INTO "Match" VALUES ("40", "1", "6");
INSERT INTO "Match" VALUES ("41", "2", "7");
INSERT INTO "Match" VALUES ("42", "2", "7");
INSERT INTO "Match" VALUES ("43", "2", "7");
INSERT INTO "Match" VALUES ("44", "4", "9");