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,
"Country" 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 ("CH1", "USA");
INSERT INTO "TV_Channel" VALUES ("CH2", "UK");
INSERT INTO "TV_Channel" VALUES ("CH3", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH4", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH5", "Japan");
INSERT INTO "Cartoon" VALUES ("101", "2023-05-10", "5001", "CH1");
INSERT INTO "Cartoon" VALUES ("102", "2023-06-15", "5002", "CH2");
INSERT INTO "Cartoon" VALUES ("103", "2023-06-15", "5003", "CH3");
INSERT INTO "Cartoon" VALUES ("104", "2023-07-01", "5004", "CH4");
INSERT INTO "Cartoon" VALUES ("105", "2023-04-20", "5005", "CH5");
INSERT INTO "Cartoon" VALUES ("106", "2023-07-01", "5006", "CH1");
INSERT INTO "Cartoon" VALUES ("107", "2023-03-30", "5007", "CH2");
INSERT INTO "TV_series" VALUES ("201", "2023-05-10", "CH1");
INSERT INTO "TV_series" VALUES ("202", "2023-06-15", "CH2");
INSERT INTO "TV_series" VALUES ("203", "2023-07-01", "CH3");
INSERT INTO "TV_series" VALUES ("204", "2023-07-01", "CH4");
INSERT INTO "TV_series" VALUES ("205", "2023-04-20", "CH5");