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





INSERT INTO "TV_Channel" VALUES ("CN", "Cartoon Network");
INSERT INTO "TV_Channel" VALUES ("DIS", "Disney Channel");
INSERT INTO "TV_Channel" VALUES ("NIC", "Nickelodeon");
INSERT INTO "TV_Channel" VALUES ("WB", "Warner Bros. Animation");
INSERT INTO "TV_Channel" VALUES ("FOX", "Fox Kids");
INSERT INTO "Cartoon" VALUES ("101", "2023-01-15", "1001", "CN");
INSERT INTO "Cartoon" VALUES ("102", "2022-11-20", "1002", "DIS");
INSERT INTO "Cartoon" VALUES ("103", "2023-03-10", "1003", "NIC");
INSERT INTO "Cartoon" VALUES ("104", "2023-01-01", "1004", "CN");
INSERT INTO "Cartoon" VALUES ("105", "2022-12-25", "1005", "WB");
INSERT INTO "Cartoon" VALUES ("106", "2023-04-05", "1006", "DIS");
INSERT INTO "Cartoon" VALUES ("107", "2023-02-28", "1007", "FOX");
INSERT INTO "Cartoon" VALUES ("108", "2023-04-01", "1008", "NIC");
INSERT INTO "Cartoon" VALUES ("109", "2023-03-30", "1009", "CN");
INSERT INTO "Cartoon" VALUES ("110", "2023-04-06", "1010", "DIS");
INSERT INTO "TV_series" VALUES ("201", "2023-01-05", "CN");
INSERT INTO "TV_series" VALUES ("202", "2022-10-10", "DIS");
INSERT INTO "TV_series" VALUES ("203", "2023-02-15", "NIC");
INSERT INTO "TV_series" VALUES ("204", "2023-01-20", "CN");
INSERT INTO "TV_series" VALUES ("205", "2022-11-01", "WB");
INSERT INTO "TV_series" VALUES ("206", "2023-03-20", "DIS");
INSERT INTO "TV_series" VALUES ("207", "2023-02-01", "FOX");
INSERT INTO "TV_series" VALUES ("208", "2023-03-25", "NIC");
INSERT INTO "TV_series" VALUES ("209", "2023-03-15", "CN");
INSERT INTO "TV_series" VALUES ("210", "2023-04-02", "DIS");