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

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





INSERT INTO "TV_Channel" VALUES ("C1", "Nature Shows");
INSERT INTO "TV_Channel" VALUES ("C2", "Kids Fun");
INSERT INTO "TV_Channel" VALUES ("C3", "Drama Central");
INSERT INTO "TV_Channel" VALUES ("C4", "Comedy Hub");
INSERT INTO "TV_Channel" VALUES ("C5", "Documentaries");
INSERT INTO "Cartoon" VALUES ("101", "Jungle Adventures", "C2");
INSERT INTO "Cartoon" VALUES ("102", "Space Explorers", "C2");
INSERT INTO "Cartoon" VALUES ("103", "Funny Pals", "C2");
INSERT INTO "Cartoon" VALUES ("104", "Ocean Tales", "C1");
INSERT INTO "Cartoon" VALUES ("105", "Mountain Mysteries", "C1");
INSERT INTO "Cartoon" VALUES ("106", "City Life", "C3");
INSERT INTO "TV_series" VALUES ("201", "2023-01-10", "C1");
INSERT INTO "TV_series" VALUES ("202", "2023-02-15", "C1");
INSERT INTO "TV_series" VALUES ("203", "2023-03-20", "C1");
INSERT INTO "TV_series" VALUES ("204", "2023-01-05", "C2");
INSERT INTO "TV_series" VALUES ("205", "2023-02-10", "C2");
INSERT INTO "TV_series" VALUES ("206", "2023-03-15", "C2");
INSERT INTO "TV_series" VALUES ("207", "2023-04-01", "C3");
INSERT INTO "TV_series" VALUES ("208", "2023-05-01", "C4");
INSERT INTO "TV_series" VALUES ("209", "2023-06-01", "C4");
INSERT INTO "TV_series" VALUES ("210", "2023-07-01", "C4");
INSERT INTO "TV_series" VALUES ("211", "2023-08-01", "C5");