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

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





INSERT INTO "TV_Channel" VALUES ("SKY", "Sky Radio", "Premium");
INSERT INTO "TV_Channel" VALUES ("BBC1", "BBC News", "Basic");
INSERT INTO "TV_Channel" VALUES ("ITV", "ITV Drama", "Standard");
INSERT INTO "TV_Channel" VALUES ("CNN", "CNN News", "Premium");
INSERT INTO "TV_Channel" VALUES ("HBO", "HBO Movies", "Premium");
INSERT INTO "TV_Channel" VALUES ("DISNEY", "Disney Channel", "Kids");
INSERT INTO "TV_Channel" VALUES ("NATGEO", "National Geographic", "Documentary");
INSERT INTO "Cartoon" VALUES ("1.0", "DISNEY");
INSERT INTO "Cartoon" VALUES ("2.0", "DISNEY");
INSERT INTO "Cartoon" VALUES ("3.0", "BBC1");
INSERT INTO "Cartoon" VALUES ("4.0", "ITV");
INSERT INTO "TV_series" VALUES ("101.0", "10M", "SKY");
INSERT INTO "TV_series" VALUES ("102.0", "5M", "BBC1");
INSERT INTO "TV_series" VALUES ("103.0", "8M", "ITV");
INSERT INTO "TV_series" VALUES ("104.0", "12M", "CNN");
INSERT INTO "TV_series" VALUES ("105.0", "15M", "HBO");
INSERT INTO "TV_series" VALUES ("106.0", "3M", "DISNEY");
INSERT INTO "TV_series" VALUES ("107.0", "7M", "NATGEO");
INSERT INTO "TV_series" VALUES ("108.0", "9M", "SKY");