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,
"Directed_by" TEXT,
"Channel" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("Channel") REFERENCES "TV_Channel"("id")
);

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

CREATE TABLE "TV_series" (
"id" FLOAT,
"Air_Date" TEXT,
PRIMARY KEY ("id")
);





INSERT INTO "TV_Channel" VALUES ("CH01", "Adventure Time", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("CH02", "Mystery Tales", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("CH03", "Cartoon World", "Canada", "French");
INSERT INTO "TV_Channel" VALUES ("CH04", "Fun Zone", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("CH05", "Kids Central", "Australia", "English");
INSERT INTO "Cartoon" VALUES ("101", "Ben Jones", "CH01");
INSERT INTO "Cartoon" VALUES ("102", "Michael Chang", "CH01");
INSERT INTO "Cartoon" VALUES ("103", "Ben Jones", "CH02");
INSERT INTO "Cartoon" VALUES ("104", "Alice Smith", "CH03");
INSERT INTO "Cartoon" VALUES ("105", "Michael Chang", "CH04");
INSERT INTO "Cartoon" VALUES ("106", "John Doe", "CH05");
INSERT INTO "Cartoon" VALUES ("107", "Ben Jones", "CH05");
INSERT INTO "Cartoon" VALUES ("108", "Michael Chang", "CH02");
INSERT INTO "TV_series" VALUES ("201", "2023-01-15");
INSERT INTO "TV_series" VALUES ("202", "2022-05-20");
INSERT INTO "TV_series" VALUES ("203", "2021-11-10");
INSERT INTO "TV_series" VALUES ("204", "2020-07-30");
INSERT INTO "TV_series" VALUES ("205", "2019-03-25");