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,
"season" TEXT,
"date" TEXT,
"home_team_goal" INT,
"away_team_goal" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("country_id") REFERENCES "Country"("id")
);



INSERT INTO "Country" VALUES ("1", "Poland");
INSERT INTO "Country" VALUES ("2", "Germany");
INSERT INTO "Country" VALUES ("3", "France");
INSERT INTO "League" VALUES ("1", "1");
INSERT INTO "League" VALUES ("2", "2");
INSERT INTO "League" VALUES ("3", "3");
INSERT INTO "Match" VALUES ("1", "1", "2010/2011", "2010-08-15", "2", "1");
INSERT INTO "Match" VALUES ("2", "1", "2010/2011", "2010-09-10", "0", "0");
INSERT INTO "Match" VALUES ("3", "1", "2010/2011", "2011-04-20", "3", "2");
INSERT INTO "Match" VALUES ("4", "1", "2010/2011", "2011-05-05", "1", "1");
INSERT INTO "Match" VALUES ("5", "1", "2009/2010", "2009-10-10", "4", "0");
INSERT INTO "Match" VALUES ("6", "2", "2010/2011", "2010-08-20", "2", "3");
INSERT INTO "Match" VALUES ("7", "3", "2010/2011", "2010-09-15", "1", "1");
INSERT INTO "Match" VALUES ("8", "1", "2011/2012", "2011-09-10", "2", "2");
INSERT INTO "Match" VALUES ("9", "1", "2010/2011", "2010-11-11", "0", "1");
INSERT INTO "Match" VALUES ("10", "1", "2010/2011", "2011-03-03", "5", "0");