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

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

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





INSERT INTO "TV_Channel" VALUES ("C1", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("C2", "Canada", "English");
INSERT INTO "TV_Channel" VALUES ("C3", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("C4", "France", "French");
INSERT INTO "TV_Channel" VALUES ("C5", "Japan", "Japanese");
INSERT INTO "TV_Channel" VALUES ("C6", "Germany", "German");
INSERT INTO "Cartoon" VALUES ("101", "Todd Casey", "C1");
INSERT INTO "Cartoon" VALUES ("102", "Todd Casey", "C2");
INSERT INTO "Cartoon" VALUES ("103", "Alice Smith", "C3");
INSERT INTO "Cartoon" VALUES ("104", "Bob Johnson", "C4");
INSERT INTO "Cartoon" VALUES ("105", "Todd Casey", "C1");
INSERT INTO "Cartoon" VALUES ("106", "Clara Oswald", "C5");
INSERT INTO "Cartoon" VALUES ("107", "David Tennant", "C6");
INSERT INTO "TV_series" VALUES ("201", "2023-01-01", "C1");
INSERT INTO "TV_series" VALUES ("202", "2023-02-01", "C2");
INSERT INTO "TV_series" VALUES ("203", "2023-03-01", "C3");
INSERT INTO "TV_series" VALUES ("204", "2023-04-01", "C4");
INSERT INTO "TV_series" VALUES ("205", "2023-05-01", "C5");
INSERT INTO "TV_series" VALUES ("206", "2023-06-01", "C6");