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

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

CREATE TABLE "TV_series" (
"id" FLOAT,
"Episode" TEXT,
"Rating" TEXT,
PRIMARY KEY ("id")
);





INSERT INTO "TV_Channel" VALUES ("CH1", "Nature Wonders", "Basic");
INSERT INTO "TV_Channel" VALUES ("CH2", "Space Adventures", "Premium");
INSERT INTO "TV_Channel" VALUES ("CH3", "History Mysteries", "Standard");
INSERT INTO "TV_Channel" VALUES ("CH4", "Comedy Central", "Basic");
INSERT INTO "TV_Channel" VALUES ("CH5", "Kids Fun", "Premium");
INSERT INTO "Cartoon" VALUES ("101", "Ben Jones", "CH1");
INSERT INTO "Cartoon" VALUES ("102", "Alice Smith", "CH2");
INSERT INTO "Cartoon" VALUES ("103", "Ben Jones", "CH2");
INSERT INTO "Cartoon" VALUES ("104", "John Doe", "CH4");
INSERT INTO "Cartoon" VALUES ("105", "Mary Jane", "CH5");
INSERT INTO "Cartoon" VALUES ("106", "Tom Lee", "CH5");
INSERT INTO "TV_series" VALUES ("201", "Episode 1", "8.5");
INSERT INTO "TV_series" VALUES ("202", "Episode 2", "7.9");
INSERT INTO "TV_series" VALUES ("203", "Episode 3", "9.0");
INSERT INTO "TV_series" VALUES ("204", "Episode 4", "6.8");
INSERT INTO "TV_series" VALUES ("205", "Episode 5", "7.2");