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,
"Air_Date" TEXT,
PRIMARY KEY ("id")
);





INSERT INTO "TV_Channel" VALUES ("C1", "Nature Wonders", "Basic");
INSERT INTO "TV_Channel" VALUES ("C2", "Space Adventures", "Premium");
INSERT INTO "TV_Channel" VALUES ("C3", "Funny Toons", "Standard");
INSERT INTO "TV_Channel" VALUES ("C4", "History Channel", "Basic");
INSERT INTO "TV_Channel" VALUES ("C5", "Kids Fun", "Premium");
INSERT INTO "TV_Channel" VALUES ("C6", "Documentaries", "Standard");
INSERT INTO "Cartoon" VALUES ("101", "Ben Jones", "C3");
INSERT INTO "Cartoon" VALUES ("102", "Alice Smith", "C1");
INSERT INTO "Cartoon" VALUES ("103", "Ben Jones", "C5");
INSERT INTO "Cartoon" VALUES ("104", "Mark Lee", "C2");
INSERT INTO "Cartoon" VALUES ("105", "Samantha Ray", "C4");
INSERT INTO "Cartoon" VALUES ("106", "John Doe", "C6");
INSERT INTO "TV_series" VALUES ("201", "Episode 1", "2023-01-10");
INSERT INTO "TV_series" VALUES ("202", "Episode 2", "2023-01-17");
INSERT INTO "TV_series" VALUES ("203", "Episode 3", "2023-01-24");
INSERT INTO "TV_series" VALUES ("204", "Episode 4", "2023-01-31");
INSERT INTO "TV_series" VALUES ("205", "Episode 5", "2023-02-07");
INSERT INTO "TV_series" VALUES ("206", "Episode 6", "2023-02-14");