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,
"Episode" TEXT,
"Air_Date" TEXT,
"Channel" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("Channel") REFERENCES "TV_Channel"("id")
);





INSERT INTO "TV_Channel" VALUES ("ABC", "General Hospital");
INSERT INTO "TV_Channel" VALUES ("NBC", "Days of Our Lives");
INSERT INTO "TV_Channel" VALUES ("CBS", "The Young and the Restless");
INSERT INTO "TV_Channel" VALUES ("FOX", "The Simpsons");
INSERT INTO "TV_Channel" VALUES ("PBS", "Sesame Street");
INSERT INTO "TV_Channel" VALUES ("HBO", "Game of Thrones");
INSERT INTO "TV_Channel" VALUES ("AMC", "The Walking Dead");
INSERT INTO "Cartoon" VALUES ("1.0", "Tom and Jerry", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("2.0", "Looney Tunes", "Boomerang");
INSERT INTO "Cartoon" VALUES ("3.0", "Scooby-Doo", "Boomerang");
INSERT INTO "Cartoon" VALUES ("4.0", "The Flintstones", "Boomerang");
INSERT INTO "Cartoon" VALUES ("5.0", "SpongeBob SquarePants", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("6.0", "Family Guy", "FOX");
INSERT INTO "Cartoon" VALUES ("7.0", "Rick and Morty", "Adult Swim");
INSERT INTO "TV_series" VALUES ("101.0", "Pilot", "2023-01-01", "ABC");
INSERT INTO "TV_series" VALUES ("102.0", "A New Beginning", "2023-01-08", "ABC");
INSERT INTO "TV_series" VALUES ("103.0", "A Love of a Lifetime", "2023-01-15", "ABC");
INSERT INTO "TV_series" VALUES ("201.0", "First Episode", "2023-02-01", "NBC");
INSERT INTO "TV_series" VALUES ("202.0", "The Big Reveal", "2023-02-08", "NBC");
INSERT INTO "TV_series" VALUES ("301.0", "Premiere", "2023-03-01", "CBS");
INSERT INTO "TV_series" VALUES ("302.0", "A Love of a Lifetime", "2023-03-08", "CBS");
INSERT INTO "TV_series" VALUES ("401.0", "Bart Gets an F", "1990-10-11", "FOX");
INSERT INTO "TV_series" VALUES ("501.0", "Cookie Monster", "1969-11-10", "PBS");
INSERT INTO "TV_series" VALUES ("601.0", "Winter Is Coming", "2011-04-17", "HBO");
INSERT INTO "TV_series" VALUES ("701.0", "Days Gone Bye", "2010-10-31", "AMC");
INSERT INTO "TV_series" VALUES ("702.0", "A Love of a Lifetime", "2011-02-20", "AMC");