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,
"Country" 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 ("C1", "Forever Love", "USA");
INSERT INTO "TV_Channel" VALUES ("C2", "Mystery Tales", "UK");
INSERT INTO "TV_Channel" VALUES ("C3", "Space Adventures", "Canada");
INSERT INTO "TV_Channel" VALUES ("C4", "Historic Legends", "Australia");
INSERT INTO "TV_Channel" VALUES ("C5", "Forever Love", "USA");
INSERT INTO "TV_Channel" VALUES ("C6", "Comedy Central", "USA");
INSERT INTO "TV_series" VALUES ("101", "A Love of a Lifetime", "2023-05-10", "C1");
INSERT INTO "TV_series" VALUES ("102", "The Final Clue", "2022-11-15", "C2");
INSERT INTO "TV_series" VALUES ("103", "Galactic Wars", "2021-07-20", "C3");
INSERT INTO "TV_series" VALUES ("104", "The Lost Kingdom", "2020-03-30", "C4");
INSERT INTO "TV_series" VALUES ("105", "A Love of a Lifetime", "2023-06-12", "C5");
INSERT INTO "TV_series" VALUES ("106", "Laugh Out Loud", "2023-01-01", "C6");
INSERT INTO "TV_series" VALUES ("107", "A Love of a Lifetime", "2023-07-01", "C6");
INSERT INTO "Cartoon" VALUES ("1", "Forever Love");
INSERT INTO "Cartoon" VALUES ("2", "Mystery Tales");
INSERT INTO "Cartoon" VALUES ("3", "Space Adventures");
INSERT INTO "Cartoon" VALUES ("4", "Historic Legends");
INSERT INTO "Cartoon" VALUES ("5", "Comedy Central");
INSERT INTO "Cartoon" VALUES ("6", "Random Cartoon");