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 ("ABC", "The Simpsons");
INSERT INTO "TV_Channel" VALUES ("NBC", "Tom and Jerry");
INSERT INTO "TV_Channel" VALUES ("CBS", "Looney Tunes");
INSERT INTO "TV_Channel" VALUES ("FOX", "Family Guy");
INSERT INTO "TV_Channel" VALUES ("DISNEY", "Mickey Mouse Clubhouse");
INSERT INTO "TV_Channel" VALUES ("CARTOON_NETWORK", "Adventure Time");
INSERT INTO "Cartoon" VALUES ("1", "2023-01-15", "101", "ABC");
INSERT INTO "Cartoon" VALUES ("2", "2022-11-20", "102", "NBC");
INSERT INTO "Cartoon" VALUES ("3", "2023-02-01", "103", "CBS");
INSERT INTO "Cartoon" VALUES ("4", "2023-01-25", "104", "FOX");
INSERT INTO "Cartoon" VALUES ("5", "2023-03-10", "105", "DISNEY");
INSERT INTO "Cartoon" VALUES ("6", "2023-03-05", "106", "CARTOON_NETWORK");
INSERT INTO "Cartoon" VALUES ("7", "2023-03-10", "107", "ABC");
INSERT INTO "Cartoon" VALUES ("8", "2023-03-11", "108", "NBC");
INSERT INTO "Cartoon" VALUES ("9", "2023-03-12", "109", "CBS");
INSERT INTO "Cartoon" VALUES ("10", "2023-03-12", "110", "FOX");
INSERT INTO "TV_series" VALUES ("1", "2023-01-10", "ABC");
INSERT INTO "TV_series" VALUES ("2", "2022-12-01", "NBC");
INSERT INTO "TV_series" VALUES ("3", "2023-02-15", "CBS");
INSERT INTO "TV_series" VALUES ("4", "2023-01-30", "FOX");
INSERT INTO "TV_series" VALUES ("5", "2023-03-01", "DISNEY");
INSERT INTO "TV_series" VALUES ("6", "2023-02-28", "CARTOON_NETWORK");