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





INSERT INTO "TV_Channel" VALUES ("CH1", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("CH2", "Canada", "English");
INSERT INTO "TV_Channel" VALUES ("CH3", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("CH4", "Australia", "English");
INSERT INTO "TV_Channel" VALUES ("CH5", "Japan", "Japanese");
INSERT INTO "TV_Channel" VALUES ("CH6", "France", "French");
INSERT INTO "Cartoon" VALUES ("101", "Adventures of Max", "Todd Casey", "CH1");
INSERT INTO "Cartoon" VALUES ("102", "Space Explorers", "Alice Johnson", "CH2");
INSERT INTO "Cartoon" VALUES ("103", "Mystery Island", "Todd Casey", "CH3");
INSERT INTO "Cartoon" VALUES ("104", "Jungle Quest", "Mark Lee", "CH4");
INSERT INTO "Cartoon" VALUES ("105", "Samurai Tales", "Hiro Tanaka", "CH5");
INSERT INTO "Cartoon" VALUES ("106", "Paris Nights", "Todd Casey", "CH6");
INSERT INTO "Cartoon" VALUES ("107", "Ocean Wonders", "Todd Casey", "CH2");
INSERT INTO "Cartoon" VALUES ("108", "City Lights", "Emma Brown", "CH1");
INSERT INTO "TV_series" VALUES ("201", "Episode 1", "CH1");
INSERT INTO "TV_series" VALUES ("202", "Episode 2", "CH2");
INSERT INTO "TV_series" VALUES ("203", "Episode 3", "CH3");
INSERT INTO "TV_series" VALUES ("204", "Episode 4", "CH4");
INSERT INTO "TV_series" VALUES ("205", "Episode 5", "CH5");
INSERT INTO "TV_series" VALUES ("206", "Episode 6", "CH6");
INSERT INTO "TV_series" VALUES ("207", "Episode 7", "CH1");
INSERT INTO "TV_series" VALUES ("208", "Episode 8", "CH2");