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

CREATE TABLE "Match" (
"id" INT,
"country_id" INT,
"league_id" INT,
PRIMARY KEY ("id"),
FOREIGN KEY ("league_id") REFERENCES "League"("id"),
FOREIGN KEY ("country_id") REFERENCES "Country"("id")
);

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



INSERT INTO "Country" VALUES ("1", "Poland");
INSERT INTO "Country" VALUES ("2", "Germany");
INSERT INTO "Country" VALUES ("3", "France");
INSERT INTO "League" VALUES ("10", "1", "Poland Ekstraklasa");
INSERT INTO "League" VALUES ("11", "2", "Bundesliga");
INSERT INTO "League" VALUES ("12", "3", "Ligue 1");
INSERT INTO "Match" VALUES ("100", "1", "10");
INSERT INTO "Match" VALUES ("101", "1", "10");
INSERT INTO "Match" VALUES ("102", "2", "11");
INSERT INTO "Match" VALUES ("103", "3", "12");
INSERT INTO "Team" VALUES ("1000", "Legia Warsaw");
INSERT INTO "Team" VALUES ("1001", "Lech Poznan");
INSERT INTO "Team" VALUES ("1002", "Bayern Munich");
INSERT INTO "Team" VALUES ("1003", "Paris Saint-Germain");