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,
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 Wonders");
INSERT INTO "TV_Channel" VALUES ("C2", "Comedy Central");
INSERT INTO "TV_Channel" VALUES ("C3", "Kids Fun");
INSERT INTO "TV_Channel" VALUES ("C4", "History Hub");
INSERT INTO "TV_Channel" VALUES ("C5", "SciFi World");
INSERT INTO "Cartoon" VALUES ("101", "Ben Jones", "C1");
INSERT INTO "Cartoon" VALUES ("102", "Alice Smith", "C2");
INSERT INTO "Cartoon" VALUES ("103", "Ben Jones", "C3");
INSERT INTO "Cartoon" VALUES ("104", "David Lee", "C2");
INSERT INTO "Cartoon" VALUES ("105", "Clara Oswald", "C4");
INSERT INTO "Cartoon" VALUES ("106", "Evan Wright", "C5");
INSERT INTO "TV_series" VALUES ("201", "2023-01-15", "C1");
INSERT INTO "TV_series" VALUES ("202", "2022-05-20", "C2");
INSERT INTO "TV_series" VALUES ("203", "2021-09-10", "C3");
INSERT INTO "TV_series" VALUES ("204", "2020-11-30", "C4");
INSERT INTO "TV_series" VALUES ("205", "2019-07-25", "C5");
INSERT INTO "TV_series" VALUES ("206", "2024-03-05", "C1");