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", "Belgium");
INSERT INTO "Country" VALUES ("2", "England");
INSERT INTO "Country" VALUES ("3", "Spain");
INSERT INTO "Country" VALUES ("4", "Germany");
INSERT INTO "Country" VALUES ("5", "Italy");
INSERT INTO "League" VALUES ("1000", "1", "Belgium Jupiler League");
INSERT INTO "League" VALUES ("1001", "2", "England Premier League");
INSERT INTO "League" VALUES ("1002", "3", "Spain La Liga");
INSERT INTO "League" VALUES ("1003", "4", "Germany Bundesliga");
INSERT INTO "League" VALUES ("1004", "5", "Italy Serie A");
INSERT INTO "League" VALUES ("1005", "1", "Belgium Second Division");
INSERT INTO "Match" VALUES ("1", "1", "1000");
INSERT INTO "Match" VALUES ("2", "2", "1001");
INSERT INTO "Match" VALUES ("3", "1", "1000");
INSERT INTO "Match" VALUES ("4", "3", "1002");
INSERT INTO "Match" VALUES ("5", "1", "1005");
INSERT INTO "Team" VALUES ("10", "RSC Anderlecht");
INSERT INTO "Team" VALUES ("11", "Club Brugge KV");
INSERT INTO "Team" VALUES ("12", "KAA Gent");
INSERT INTO "Team" VALUES ("13", "Manchester United");
INSERT INTO "Team" VALUES ("14", "Real Madrid");