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





INSERT INTO "TV_Channel" VALUES ("CH1", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("CH2", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("CH3", "USA", "Spanish");
INSERT INTO "TV_Channel" VALUES ("CH4", "Canada", "English");
INSERT INTO "TV_Channel" VALUES ("CH5", "Canada", "French");
INSERT INTO "TV_Channel" VALUES ("CH6", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("CH7", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("CH8", "UK", "Welsh");
INSERT INTO "TV_Channel" VALUES ("CH9", "France", "French");
INSERT INTO "TV_Channel" VALUES ("CH10", "France", "French");
INSERT INTO "Cartoon" VALUES ("1", "CH1");
INSERT INTO "Cartoon" VALUES ("2", "CH2");
INSERT INTO "Cartoon" VALUES ("3", "CH4");
INSERT INTO "Cartoon" VALUES ("4", "CH6");
INSERT INTO "Cartoon" VALUES ("5", "CH7");
INSERT INTO "Cartoon" VALUES ("6", "CH9");
INSERT INTO "TV_series" VALUES ("101", "CH1");
INSERT INTO "TV_series" VALUES ("102", "CH2");
INSERT INTO "TV_series" VALUES ("103", "CH3");
INSERT INTO "TV_series" VALUES ("104", "CH5");
INSERT INTO "TV_series" VALUES ("105", "CH6");
INSERT INTO "TV_series" VALUES ("106", "CH7");
INSERT INTO "TV_series" VALUES ("107", "CH8");
INSERT INTO "TV_series" VALUES ("108", "CH10");