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,
"country_id" INT,
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", "France");
INSERT INTO "Country" VALUES ("3", "Germany");
INSERT INTO "League" VALUES ("10", "1");
INSERT INTO "League" VALUES ("20", "2");
INSERT INTO "League" VALUES ("30", "3");
INSERT INTO "Match" VALUES ("100", "1", "10", "2008/2009", "2008-09-15");
INSERT INTO "Match" VALUES ("101", "1", "10", "2008/2009", "2009-03-22");
INSERT INTO "Match" VALUES ("102", "1", "10", "2007/2008", "2008-05-10");
INSERT INTO "Match" VALUES ("103", "1", "10", "2008/2009", "2009-05-05");
INSERT INTO "Match" VALUES ("104", "2", "20", "2008/2009", "2008-10-12");
INSERT INTO "Match" VALUES ("105", "2", "20", "2008/2009", "2009-04-18");
INSERT INTO "Match" VALUES ("106", "3", "30", "2008/2009", "2008-11-30");
INSERT INTO "Match" VALUES ("107", "1", "10", "2009/2010", "2009-09-20");
INSERT INTO "Match" VALUES ("108", "1", "10", "2008/2009", "2008-12-01");
INSERT INTO "Match" VALUES ("109", "1", "10", "2008/2009", "2009-01-15");