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

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





INSERT INTO "TV_Channel" VALUES ("Cartoon Network", "Kids Pack");
INSERT INTO "TV_Channel" VALUES ("Nickelodeon", "Kids Pack");
INSERT INTO "TV_Channel" VALUES ("Disney Channel", "Family Pack");
INSERT INTO "TV_Channel" VALUES ("Adult Swim", "Adult Pack");
INSERT INTO "TV_Channel" VALUES ("Discovery Channel", "Standard Pack");
INSERT INTO "TV_Channel" VALUES ("HBO", "Premium Pack");
INSERT INTO "TV_Channel" VALUES ("Netflix", "Streaming Pack");
INSERT INTO "Cartoon" VALUES ("101", "Genndy Tartakovsky", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("102", "Ben Jones", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("103", "Craig McCracken", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("104", "Butch Hartman", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("105", "Ben Jones", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("106", "Seth MacFarlane", "Adult Swim");
INSERT INTO "Cartoon" VALUES ("107", "Rebecca Sugar", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("108", "Matt Groening", "Disney Channel");
INSERT INTO "Cartoon" VALUES ("109", "Ben Jones", "Disney Channel");
INSERT INTO "Cartoon" VALUES ("110", "John Kricfalusi", "Nickelodeon");
INSERT INTO "TV_series" VALUES ("201", "2023-01-15", "1.5", "Discovery Channel");
INSERT INTO "TV_series" VALUES ("202", "2023-02-20", "2.1", "HBO");
INSERT INTO "TV_series" VALUES ("203", "2023-03-10", "0.8", "Cartoon Network");
INSERT INTO "TV_series" VALUES ("204", "2023-04-05", "1.2", "Nickelodeon");
INSERT INTO "TV_series" VALUES ("205", "2023-05-01", "3.0", "Netflix");
INSERT INTO "TV_series" VALUES ("206", "2023-06-12", "0.5", "Adult Swim");
INSERT INTO "TV_series" VALUES ("207", "2023-07-01", "1.8", "Disney Channel");
INSERT INTO "TV_series" VALUES ("208", "2023-08-10", "2.5", "HBO");
INSERT INTO "TV_series" VALUES ("209", "2023-09-15", "0.9", "Discovery Channel");
INSERT INTO "TV_series" VALUES ("210", "2023-10-20", "1.1", "Netflix");