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

CREATE TABLE "TV_series" (
"id" FLOAT,
"Rating" TEXT,
"Share" FLOAT,
"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", "Germany");
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 "TV_series" VALUES ("201", "8.5", "15.2", "CH1");
INSERT INTO "TV_series" VALUES ("202", "7.0", "5.0", "CH1");
INSERT INTO "TV_series" VALUES ("203", "9.0", "25.5", "CH2");
INSERT INTO "TV_series" VALUES ("204", "6.5", "3.3", "CH2");
INSERT INTO "TV_series" VALUES ("205", "8.0", "18.0", "CH3");
INSERT INTO "TV_series" VALUES ("206", "7.5", "2.0", "CH3");
INSERT INTO "TV_series" VALUES ("207", "9.5", "30.0", "CH4");
INSERT INTO "TV_series" VALUES ("208", "6.0", "1.5", "CH4");
INSERT INTO "TV_series" VALUES ("209", "8.2", "10.0", "CH5");
INSERT INTO "TV_series" VALUES ("210", "7.8", "0.5", "CH5");