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 ("HBO", "Game of Thrones");
INSERT INTO "TV_Channel" VALUES ("DISNEY", "Mickey Mouse Clubhouse");
INSERT INTO "TV_Channel" VALUES ("CARTOON", "Adventure Time");
INSERT INTO "Cartoon" VALUES ("101", "Tom and Jerry", "CARTOON");
INSERT INTO "Cartoon" VALUES ("102", "Looney Tunes", "CARTOON");
INSERT INTO "Cartoon" VALUES ("103", "Scooby-Doo", "CARTOON");
INSERT INTO "Cartoon" VALUES ("104", "Mickey Mouse", "DISNEY");
INSERT INTO "Cartoon" VALUES ("105", "Donald Duck", "DISNEY");
INSERT INTO "TV_series" VALUES ("1", "Pilot", "1963-04-01", "ABC");
INSERT INTO "TV_series" VALUES ("2", "A Love of a Lifetime", "1965-07-15", "ABC");
INSERT INTO "TV_series" VALUES ("3", "The Wedding", "1970-01-20", "NBC");
INSERT INTO "TV_series" VALUES ("4", "The Big Reveal", "1973-03-10", "CBS");
INSERT INTO "TV_series" VALUES ("5", "Bart Gets an F", "1990-10-11", "FOX");
INSERT INTO "TV_series" VALUES ("6", "Winter Is Coming", "2011-04-17", "HBO");
INSERT INTO "TV_series" VALUES ("7", "The Red Wedding", "2013-06-02", "HBO");
INSERT INTO "TV_series" VALUES ("8", "The Final Episode", "2019-05-19", "HBO");
INSERT INTO "TV_series" VALUES ("9", "A New Beginning", "1963-04-02", "ABC");
INSERT INTO "TV_series" VALUES ("10", "The First Kiss", "1965-07-16", "ABC");
INSERT INTO "TV_series" VALUES ("11", "The Mystery of the Missing Toy", "2006-05-05", "DISNEY");
INSERT INTO "TV_series" VALUES ("12", "The Great Candy Chase", "2010-09-10", "CARTOON");