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 ("CN", "Cartoon Network Shows");
INSERT INTO "TV_Channel" VALUES ("DIS", "Disney Channel Series");
INSERT INTO "TV_Channel" VALUES ("NICK", "Nickelodeon Classics");
INSERT INTO "TV_Channel" VALUES ("PBS", "PBS Kids");
INSERT INTO "TV_Channel" VALUES ("ABC", "ABC Family Shows");
INSERT INTO "Cartoon" VALUES ("1.0", "Tom and Jerry", "CN");
INSERT INTO "Cartoon" VALUES ("2.0", "Looney Tunes", "CN");
INSERT INTO "Cartoon" VALUES ("3.0", "Mickey Mouse Clubhouse", "DIS");
INSERT INTO "Cartoon" VALUES ("4.0", "SpongeBob SquarePants", "NICK");
INSERT INTO "Cartoon" VALUES ("5.0", "Arthur", "PBS");
INSERT INTO "TV_series" VALUES ("101.0", "Pilot Episode", "2020-01-01", "CN");
INSERT INTO "TV_series" VALUES ("102.0", "The Big Race", "2020-01-08", "CN");
INSERT INTO "TV_series" VALUES ("201.0", "A New Beginning", "2019-05-15", "DIS");
INSERT INTO "TV_series" VALUES ("202.0", "A Love of a Lifetime", "2019-05-22", "DIS");
INSERT INTO "TV_series" VALUES ("301.0", "Under the Sea", "2021-03-10", "NICK");
INSERT INTO "TV_series" VALUES ("401.0", "School Days", "2018-11-01", "PBS");
INSERT INTO "TV_series" VALUES ("501.0", "Family Matters", "2022-07-01", "ABC");
INSERT INTO "TV_series" VALUES ("502.0", "A Love of a Lifetime", "2022-07-08", "ABC");