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

CREATE TABLE "TV_Channel" (
"id" TEXT UNIQUE,
"series_name" TEXT,
PRIMARY KEY ("id")
);

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





INSERT INTO "Cartoon" VALUES ("1", "Adventure Time");
INSERT INTO "Cartoon" VALUES ("2", "Rick and Morty");
INSERT INTO "Cartoon" VALUES ("3", "Gravity Falls");
INSERT INTO "Cartoon" VALUES ("4", "Steven Universe");
INSERT INTO "Cartoon" VALUES ("5", "The Simpsons");
INSERT INTO "TV_Channel" VALUES ("CN", "Cartoon Network");
INSERT INTO "TV_Channel" VALUES ("AD", "Adult Swim");
INSERT INTO "TV_Channel" VALUES ("DS", "Disney Channel");
INSERT INTO "TV_Channel" VALUES ("FX", "FX Network");
INSERT INTO "TV_Channel" VALUES ("FOX", "Fox Network");
INSERT INTO "TV_series" VALUES ("101", "The Enchiridion!", "8.5", "2.3", "CN");
INSERT INTO "TV_series" VALUES ("102", "Lawn Gnome Beach Party of Terror", "7.9", "1.8", "CN");
INSERT INTO "TV_series" VALUES ("103", "Pilot", "9.2", "3.1", "AD");
INSERT INTO "TV_series" VALUES ("104", "Lawnmower Dog", "8.7", "2.9", "AD");
INSERT INTO "TV_series" VALUES ("105", "Tourist Trapped", "9.0", "2.5", "DS");
INSERT INTO "TV_series" VALUES ("106", "The Legend of the Gobblewonker", "7.5", "1.7", "DS");
INSERT INTO "TV_series" VALUES ("107", "Giant Woman", "8.0", "2.0", "FX");
INSERT INTO "TV_series" VALUES ("108", "Laser Light Cannon", "7.8", "1.9", "FX");
INSERT INTO "TV_series" VALUES ("109", "Bart Gets an F", "8.3", "3.5", "FOX");
INSERT INTO "TV_series" VALUES ("110", "Homer's Odyssey", "7.6", "3.0", "FOX");
INSERT INTO "TV_series" VALUES ("111", "Edge Case Episode", "9.2", "3.2", "AD");
INSERT INTO "TV_series" VALUES ("112", "Lowest Rated Episode", "5.0", "0.5", "CN");
INSERT INTO "TV_series" VALUES ("113", "Mid Rated Episode", "7.0", "1.0", "DS");