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", "Netherlands");
INSERT INTO "Country" VALUES ("2", "Germany");
INSERT INTO "Country" VALUES ("3", "Spain");
INSERT INTO "Country" VALUES ("4", "Italy");
INSERT INTO "League" VALUES ("10", "1", "Eredivisie");
INSERT INTO "League" VALUES ("11", "2", "Bundesliga");
INSERT INTO "League" VALUES ("12", "3", "La Liga");
INSERT INTO "League" VALUES ("13", "4", "Serie A");
INSERT INTO "League" VALUES ("14", "1", "Eerste Divisie");
INSERT INTO "Team" VALUES ("100", "Ajax Amsterdam");
INSERT INTO "Team" VALUES ("101", "PSV Eindhoven");
INSERT INTO "Team" VALUES ("102", "Feyenoord Rotterdam");
INSERT INTO "Team" VALUES ("103", "Bayern Munich");
INSERT INTO "Team" VALUES ("104", "Real Madrid");
INSERT INTO "Team" VALUES ("105", "Juventus");
INSERT INTO "Match" VALUES ("1000", "1", "10");
INSERT INTO "Match" VALUES ("1001", "1", "14");
INSERT INTO "Match" VALUES ("1002", "2", "11");
INSERT INTO "Match" VALUES ("1003", "3", "12");
INSERT INTO "Match" VALUES ("1004", "4", "13");
INSERT INTO "Match" VALUES ("1005", "1", "10");
INSERT INTO "Match" VALUES ("1006", "1", "14");