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,
"Language" TEXT,
PRIMARY KEY ("id")
);

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





INSERT INTO "TV_Channel" VALUES ("CH1", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("CH2", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("CH3", "Japan", "Japanese");
INSERT INTO "TV_Channel" VALUES ("CH4", "France", "French");
INSERT INTO "TV_Channel" VALUES ("CH5", "Germany", "German");
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-04-20", "5004", "CH4");
INSERT INTO "Cartoon" VALUES ("105", "2023-06-14", "5005", "CH5");
INSERT INTO "Cartoon" VALUES ("106", "2023-06-15", "5006", "CH1");
INSERT INTO "TV_series" VALUES ("201", "2023-01-01");
INSERT INTO "TV_series" VALUES ("202", "2023-06-15");
INSERT INTO "TV_series" VALUES ("203", "2023-03-10");