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 ("SKY001", "Sky Radio");
INSERT INTO "TV_Channel" VALUES ("BBC001", "BBC One");
INSERT INTO "TV_Channel" VALUES ("CNN001", "CNN News");
INSERT INTO "TV_Channel" VALUES ("DIS001", "Discovery Channel");
INSERT INTO "TV_Channel" VALUES ("HBO001", "HBO");
INSERT INTO "Cartoon" VALUES ("1.0", "Tom and Jerry", "BBC001");
INSERT INTO "Cartoon" VALUES ("2.0", "Looney Tunes", "SKY001");
INSERT INTO "Cartoon" VALUES ("3.0", "Scooby Doo", "BBC001");
INSERT INTO "Cartoon" VALUES ("4.0", "The Flintstones", "SKY001");
INSERT INTO "Cartoon" VALUES ("5.0", "SpongeBob SquarePants", "DIS001");
INSERT INTO "TV_series" VALUES ("101.0", "Episode 1: The Beginning", "2023-01-05", "SKY001");
INSERT INTO "TV_series" VALUES ("102.0", "Episode 2: A New Hope", "2023-01-12", "SKY001");
INSERT INTO "TV_series" VALUES ("103.0", "Episode 3: The Empire Strikes Back", "2023-01-19", "BBC001");
INSERT INTO "TV_series" VALUES ("104.0", "Episode 4: Return of the Jedi", "2023-01-26", "SKY001");
INSERT INTO "TV_series" VALUES ("105.0", "Episode 1: Breaking News", "2023-02-01", "CNN001");
INSERT INTO "TV_series" VALUES ("106.0", "Episode 1: Planet Earth", "2023-03-10", "DIS001");
INSERT INTO "TV_series" VALUES ("107.0", "Episode 5: The Force Awakens", "2023-02-02", "SKY001");
INSERT INTO "TV_series" VALUES ("108.0", "Episode 6: The Last Jedi", "2023-02-09", "BBC001");
INSERT INTO "TV_series" VALUES ("109.0", "Episode 7: The Rise of Skywalker", "2023-02-16", "SKY001");
INSERT INTO "TV_series" VALUES ("110.0", "Episode 2: World Events", "2023-02-08", "CNN001");