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 "Cartoon" (
"id" FLOAT,
"Channel" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("Channel") REFERENCES "TV_Channel"("id")
);

CREATE TABLE "TV_Channel" (
"id" TEXT UNIQUE,
"Country" TEXT,
"Language" TEXT,
PRIMARY KEY ("id")
);

CREATE TABLE "TV_series" (
"id" FLOAT,
"Channel" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("Channel") REFERENCES "TV_Channel"("id")
);





INSERT INTO "Cartoon" VALUES ("1.0", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("2.0", "Disney Channel");
INSERT INTO "Cartoon" VALUES ("3.0", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("4.0", "Boomerang");
INSERT INTO "Cartoon" VALUES ("5.0", "Discovery Kids");
INSERT INTO "Cartoon" VALUES ("6.0", "PBS Kids");
INSERT INTO "Cartoon" VALUES ("7.0", "Teletoon");
INSERT INTO "Cartoon" VALUES ("8.0", "YTV");
INSERT INTO "TV_Channel" VALUES ("Cartoon Network", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("Disney Channel", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("Nickelodeon", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("Boomerang", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("Discovery Kids", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("PBS Kids", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("Teletoon", "Canada", "English");
INSERT INTO "TV_Channel" VALUES ("YTV", "Canada", "English");
INSERT INTO "TV_Channel" VALUES ("TF1", "France", "French");
INSERT INTO "TV_Channel" VALUES ("ZDF", "Germany", "German");
INSERT INTO "TV_Channel" VALUES ("RAI 1", "Italy", "Italian");
INSERT INTO "TV_Channel" VALUES ("TV Globo", "Brazil", "Portuguese");
INSERT INTO "TV_Channel" VALUES ("CCTV-1", "China", "Mandarin");
INSERT INTO "TV_Channel" VALUES ("NHK General TV", "Japan", "Japanese");
INSERT INTO "TV_Channel" VALUES ("BBC One", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("ITV", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("Antena 3", "Spain", "Spanish");
INSERT INTO "TV_series" VALUES ("101.0", "Cartoon Network");
INSERT INTO "TV_series" VALUES ("102.0", "Disney Channel");
INSERT INTO "TV_series" VALUES ("103.0", "Nickelodeon");
INSERT INTO "TV_series" VALUES ("104.0", "Boomerang");
INSERT INTO "TV_series" VALUES ("105.0", "Discovery Kids");
INSERT INTO "TV_series" VALUES ("106.0", "PBS Kids");
INSERT INTO "TV_series" VALUES ("107.0", "Teletoon");
INSERT INTO "TV_series" VALUES ("108.0", "YTV");
INSERT INTO "TV_series" VALUES ("109.0", "TF1");
INSERT INTO "TV_series" VALUES ("110.0", "ZDF");
INSERT INTO "TV_series" VALUES ("111.0", "BBC One");
INSERT INTO "TV_series" VALUES ("112.0", "ITV");
INSERT INTO "TV_series" VALUES ("113.0", "Antena 3");