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,
"season" 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", "Netherlands");
INSERT INTO "Country" VALUES ("3", "Germany");
INSERT INTO "Country" VALUES ("4", "France");
INSERT INTO "Country" VALUES ("5", "Italy");
INSERT INTO "League" VALUES ("10", "1", "Belgium Jupiler League");
INSERT INTO "League" VALUES ("11", "2", "Eredivisie");
INSERT INTO "League" VALUES ("12", "3", "Bundesliga");
INSERT INTO "League" VALUES ("13", "4", "Ligue 1");
INSERT INTO "League" VALUES ("14", "5", "Serie A");
INSERT INTO "Match" VALUES ("100", "1", "10", "2022/2023");
INSERT INTO "Match" VALUES ("101", "1", "10", "2021/2022");
INSERT INTO "Match" VALUES ("102", "2", "11", "2022/2023");
INSERT INTO "Match" VALUES ("103", "3", "12", "2022/2023");
INSERT INTO "Match" VALUES ("104", "4", "13", "2022/2023");
INSERT INTO "Match" VALUES ("105", "5", "14", "2022/2023");
INSERT INTO "Match" VALUES ("106", "1", "10", "2020/2021");
INSERT INTO "Match" VALUES ("107", "1", "10", "2019/2020");