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

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





INSERT INTO "TV_Channel" VALUES ("CH01", "Superhero Central", "USA");
INSERT INTO "TV_Channel" VALUES ("CH02", "Kids Fun Network", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH03", "Animation World", "UK");
INSERT INTO "TV_Channel" VALUES ("CH04", "Cartoon Galaxy", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH05", "Epic Toons", "USA");
INSERT INTO "Cartoon" VALUES ("101", "The Rise of the Blue Beetle", "CH01");
INSERT INTO "Cartoon" VALUES ("102", "Jungle Adventures", "CH02");
INSERT INTO "Cartoon" VALUES ("103", "Space Explorers", "CH03");
INSERT INTO "Cartoon" VALUES ("104", "Mystic Tales", "CH04");
INSERT INTO "Cartoon" VALUES ("105", "The Rise of the Blue Beetle", "CH05");
INSERT INTO "Cartoon" VALUES ("106", "Ocean Quest", "CH02");
INSERT INTO "Cartoon" VALUES ("107", "The Rise of the Blue Beetle", "CH03");
INSERT INTO "TV_series" VALUES ("201", "Pilot", "2023-01-15");
INSERT INTO "TV_series" VALUES ("202", "The Beginning", "2023-02-20");
INSERT INTO "TV_series" VALUES ("203", "New Horizons", "2023-03-10");
INSERT INTO "TV_series" VALUES ("204", "The Rise of the Blue Beetle Special", "2023-04-05");
INSERT INTO "TV_series" VALUES ("205", "Finale", "2023-05-01");