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

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

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





INSERT INTO "TV_Channel" VALUES ("CH01", "Superhero Central", "USA");
INSERT INTO "TV_Channel" VALUES ("CH02", "Kids Fun Network", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH03", "Animation World", "UK");
INSERT INTO "TV_Channel" VALUES ("CH04", "Cartoon Galaxy", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH05", "Epic Toons", "USA");
INSERT INTO "Cartoon" VALUES ("101", "The Rise of the Blue Beetle!", "CH01");
INSERT INTO "Cartoon" VALUES ("102", "Jungle Adventures", "CH02");
INSERT INTO "Cartoon" VALUES ("103", "Space Explorers", "CH03");
INSERT INTO "Cartoon" VALUES ("104", "Mystic Tales", "CH04");
INSERT INTO "Cartoon" VALUES ("105", "Robot Warriors", "CH05");
INSERT INTO "Cartoon" VALUES ("106", "The Rise of the Blue Beetle!", "CH05");
INSERT INTO "TV_series" VALUES ("201", "Episode 1: The Beginning", "CH01");
INSERT INTO "TV_series" VALUES ("202", "Episode 2: The Challenge", "CH01");
INSERT INTO "TV_series" VALUES ("203", "Episode 1: Jungle Call", "CH02");
INSERT INTO "TV_series" VALUES ("204", "Episode 1: Starship Launch", "CH03");
INSERT INTO "TV_series" VALUES ("205", "Episode 1: The Secret", "CH04");
INSERT INTO "TV_series" VALUES ("206", "Episode 1: Rise of the Machines", "CH05");
INSERT INTO "TV_series" VALUES ("207", "Episode 2: Blue Beetle Returns", "CH05");