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

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



INSERT INTO "League" VALUES ("1", "England Premier League");
INSERT INTO "League" VALUES ("2", "Scotland Premier League");
INSERT INTO "League" VALUES ("3", "Spain La Liga");
INSERT INTO "League" VALUES ("4", "Germany Bundesliga");
INSERT INTO "League" VALUES ("5", "Italy Serie A");
INSERT INTO "Match" VALUES ("1", "1", "1", "2015/2016", "2015-08-08", "1001");
INSERT INTO "Match" VALUES ("2", "1", "1", "2015/2016", "2015-08-08", "1002");
INSERT INTO "Match" VALUES ("3", "2", "2", "2015/2016", "2015-08-08", "2001");
INSERT INTO "Match" VALUES ("4", "2", "2", "2015/2016", "2015-08-08", "2002");
INSERT INTO "Match" VALUES ("5", "2", "2", "2015/2016", "2015-08-15", "2003");
INSERT INTO "Match" VALUES ("6", "3", "3", "2015/2016", "2015-08-22", "3001");
INSERT INTO "Match" VALUES ("7", "2", "2", "2014/2015", "2014-08-09", "2001");
INSERT INTO "Match" VALUES ("8", "2", "2", "2015/2016", "2015-08-22", "2004");
INSERT INTO "Match" VALUES ("9", "1", "1", "2014/2015", "2014-08-10", "1003");
INSERT INTO "Match" VALUES ("10", "2", "2", "2015/2016", "2015-08-29", "2005");
INSERT INTO "Match" VALUES ("11", "2", "2", "2015/2016", "2015-09-05", "2006");
INSERT INTO "Match" VALUES ("12", "2", "2", "2016/2017", "2016-08-06", "2001");