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 ("ABC", "Basic");
INSERT INTO "TV_Channel" VALUES ("NBC", "Premium");
INSERT INTO "TV_Channel" VALUES ("CBS", "Family");
INSERT INTO "TV_Channel" VALUES ("FOX", "Sports");
INSERT INTO "TV_Channel" VALUES ("PBS", "Educational");
INSERT INTO "TV_Channel" VALUES ("HBO", "Movie");
INSERT INTO "TV_Channel" VALUES ("Cartoon Network", "Kids");
INSERT INTO "TV_Channel" VALUES ("Disney Channel", "Kids");
INSERT INTO "TV_Channel" VALUES ("Nickelodeon", "Kids");
INSERT INTO "Cartoon" VALUES ("1.0", "Ben Jones", "ABC");
INSERT INTO "Cartoon" VALUES ("2.0", "John Smith", "NBC");
INSERT INTO "Cartoon" VALUES ("3.0", "Ben Jones", "CBS");
INSERT INTO "Cartoon" VALUES ("4.0", "Jane Doe", "FOX");
INSERT INTO "Cartoon" VALUES ("5.0", "Chris Lee", "PBS");
INSERT INTO "Cartoon" VALUES ("6.0", "Ben Jones", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("7.0", "Sarah Brown", "Disney Channel");
INSERT INTO "Cartoon" VALUES ("8.0", "David Green", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("9.0", "Emily White", "NBC");
INSERT INTO "Cartoon" VALUES ("10.0", "Ben Jones", "HBO");
INSERT INTO "TV_series" VALUES ("101.0", "2023-01-15", "12.5", "ABC");
INSERT INTO "TV_series" VALUES ("102.0", "2023-02-20", "8.2", "NBC");
INSERT INTO "TV_series" VALUES ("103.0", "2023-03-10", "15.1", "CBS");
INSERT INTO "TV_series" VALUES ("104.0", "2023-04-05", "6.7", "FOX");
INSERT INTO "TV_series" VALUES ("105.0", "2023-05-01", "3.9", "PBS");
INSERT INTO "TV_series" VALUES ("106.0", "2023-06-12", "20.0", "HBO");
INSERT INTO "TV_series" VALUES ("107.0", "2023-07-01", "4.5", "Cartoon Network");
INSERT INTO "TV_series" VALUES ("108.0", "2023-08-18", "5.0", "Disney Channel");
INSERT INTO "TV_series" VALUES ("109.0", "2023-09-22", "4.8", "Nickelodeon");
INSERT INTO "TV_series" VALUES ("110.0", "2023-10-30", "9.1", "NBC");