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

CREATE TABLE "League" (
"id" INT UNIQUE,
"name" TEXT,
PRIMARY KEY ("id")
);

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

CREATE TABLE "Team" (
"id" INT,
"team_long_name" TEXT,
PRIMARY KEY ("id")
);



INSERT INTO "Country" VALUES ("1");
INSERT INTO "Country" VALUES ("2");
INSERT INTO "League" VALUES ("1", "Belgium Jupiler League");
INSERT INTO "League" VALUES ("2", "English Premier League");
INSERT INTO "Team" VALUES ("1", "Club Brugge KV");
INSERT INTO "Team" VALUES ("2", "RSC Anderlecht");
INSERT INTO "Team" VALUES ("3", "Standard Liège");
INSERT INTO "Team" VALUES ("4", "Manchester United");
INSERT INTO "Team" VALUES ("5", "Chelsea FC");
INSERT INTO "Match" VALUES ("1", "1", "1", "2009-04-01");
INSERT INTO "Match" VALUES ("2", "1", "2", "2009-04-15");
INSERT INTO "Match" VALUES ("3", "1", "3", "2009-04-30");
INSERT INTO "Match" VALUES ("4", "1", "4", "2009-03-31");
INSERT INTO "Match" VALUES ("5", "1", "5", "2009-05-01");
INSERT INTO "Match" VALUES ("6", "2", "1", "2009-04-10");
INSERT INTO "Match" VALUES ("7", "2", "2", "2009-04-20");
INSERT INTO "Match" VALUES ("8", "1", "6", "2009-04-10");
INSERT INTO "Match" VALUES ("9", "1", "7", "2009-04-25");
INSERT INTO "Match" VALUES ("10", "1", "8", "2008-04-15");