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,
"season" TEXT,
"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", "Germany 1. Bundesliga");
INSERT INTO "League" VALUES ("2", "England Premier League");
INSERT INTO "League" VALUES ("3", "Spain La Liga");
INSERT INTO "Team" VALUES ("1", "Bayern Munich");
INSERT INTO "Team" VALUES ("2", "Borussia Dortmund");
INSERT INTO "Team" VALUES ("3", "Hamburger SV");
INSERT INTO "Team" VALUES ("4", "Chelsea FC");
INSERT INTO "Team" VALUES ("5", "Manchester United");
INSERT INTO "Team" VALUES ("6", "Real Madrid");
INSERT INTO "Team" VALUES ("7", "Barcelona");
INSERT INTO "Match" VALUES ("1", "1", "2008/2009", "2008-08-10");
INSERT INTO "Match" VALUES ("2", "1", "2008/2009", "2008-08-25");
INSERT INTO "Match" VALUES ("3", "1", "2008/2009", "2008-09-05");
INSERT INTO "Match" VALUES ("4", "1", "2008/2009", "2008-09-20");
INSERT INTO "Match" VALUES ("5", "1", "2008/2009", "2008-10-15");
INSERT INTO "Match" VALUES ("6", "1", "2008/2009", "2008-10-30");
INSERT INTO "Match" VALUES ("7", "1", "2008/2009", "2008-11-01");
INSERT INTO "Match" VALUES ("8", "2", "2008/2009", "2008-09-10");
INSERT INTO "Match" VALUES ("9", "3", "2008/2009", "2008-09-15");
INSERT INTO "Match" VALUES ("10", "1", "2007/2008", "2008-09-10");