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

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



INSERT INTO "Country" VALUES ("1", "Belgium");
INSERT INTO "Country" VALUES ("2", "England");
INSERT INTO "Country" VALUES ("3", "France");
INSERT INTO "Country" VALUES ("4", "Germany");
INSERT INTO "Country" VALUES ("5", "Italy");
INSERT INTO "League" VALUES ("100", "Belgian Pro League");
INSERT INTO "League" VALUES ("101", "Premier League");
INSERT INTO "League" VALUES ("102", "Ligue 1");
INSERT INTO "League" VALUES ("103", "Bundesliga");
INSERT INTO "League" VALUES ("104", "Serie A");
INSERT INTO "Match" VALUES ("1", "1", "100", "2008/2009", "2008-08-15");
INSERT INTO "Match" VALUES ("2", "1", "100", "2008/2009", "2008-08-22");
INSERT INTO "Match" VALUES ("3", "1", "100", "2008/2009", "2008-08-29");
INSERT INTO "Match" VALUES ("4", "1", "100", "2009/2010", "2009-08-14");
INSERT INTO "Match" VALUES ("5", "2", "101", "2008/2009", "2008-08-16");
INSERT INTO "Match" VALUES ("6", "2", "101", "2008/2009", "2008-08-23");
INSERT INTO "Match" VALUES ("7", "1", "100", "2008/2009", "2009-03-01");
INSERT INTO "Match" VALUES ("8", "1", "100", "2007/2008", "2007-09-01");
INSERT INTO "Match" VALUES ("9", "3", "102", "2008/2009", "2008-08-17");
INSERT INTO "Match" VALUES ("10", "1", "100", "2008/2009", "2009-04-10");