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

CREATE TABLE "TV_series" (
"id" FLOAT,
"Rating" TEXT,
"Channel" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("Channel") REFERENCES "TV_Channel"("id")
);





INSERT INTO "TV_Channel" VALUES ("CH1", "English");
INSERT INTO "TV_Channel" VALUES ("CH2", "Spanish");
INSERT INTO "TV_Channel" VALUES ("CH3", "English");
INSERT INTO "TV_Channel" VALUES ("CH4", "French");
INSERT INTO "TV_Channel" VALUES ("CH5", "Spanish");
INSERT INTO "TV_Channel" VALUES ("CH6", "German");
INSERT INTO "TV_Channel" VALUES ("CH7", "English");
INSERT INTO "TV_Channel" VALUES ("CH8", "French");
INSERT INTO "TV_Channel" VALUES ("CH9", "German");
INSERT INTO "TV_Channel" VALUES ("CH10", "Italian");
INSERT INTO "Cartoon" VALUES ("101", "CH1");
INSERT INTO "Cartoon" VALUES ("102", "CH2");
INSERT INTO "Cartoon" VALUES ("103", "CH3");
INSERT INTO "Cartoon" VALUES ("104", "CH4");
INSERT INTO "Cartoon" VALUES ("105", "CH5");
INSERT INTO "Cartoon" VALUES ("106", "CH6");
INSERT INTO "Cartoon" VALUES ("107", "CH7");
INSERT INTO "Cartoon" VALUES ("108", "CH8");
INSERT INTO "Cartoon" VALUES ("109", "CH9");
INSERT INTO "Cartoon" VALUES ("110", "CH10");
INSERT INTO "TV_series" VALUES ("201", "8.5", "CH1");
INSERT INTO "TV_series" VALUES ("202", "7.2", "CH2");
INSERT INTO "TV_series" VALUES ("203", "9.0", "CH3");
INSERT INTO "TV_series" VALUES ("204", "6.8", "CH4");
INSERT INTO "TV_series" VALUES ("205", "7.5", "CH5");
INSERT INTO "TV_series" VALUES ("206", "8.0", "CH6");
INSERT INTO "TV_series" VALUES ("207", "9.1", "CH7");
INSERT INTO "TV_series" VALUES ("208", "7.9", "CH8");
INSERT INTO "TV_series" VALUES ("209", "6.5", "CH9");
INSERT INTO "TV_series" VALUES ("210", "8.3", "CH10");
INSERT INTO "TV_series" VALUES ("211", "7.0", "CH1");
INSERT INTO "TV_series" VALUES ("212", "8.7", "CH3");
INSERT INTO "TV_series" VALUES ("213", "6.9", "CH7");
INSERT INTO "TV_series" VALUES ("214", "7.8", "CH2");
INSERT INTO "TV_series" VALUES ("215", "8.2", "CH5");