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 ("CNN", "USA", "English");
INSERT INTO "TV_Channel" VALUES ("BBC", "UK", "English");
INSERT INTO "TV_Channel" VALUES ("TF1", "France", "French");
INSERT INTO "TV_Channel" VALUES ("ZDF", "Germany", "German");
INSERT INTO "TV_Channel" VALUES ("NHK", "Japan", "Japanese");
INSERT INTO "TV_Channel" VALUES ("CCTV", "China", "Mandarin");
INSERT INTO "TV_Channel" VALUES ("Rai", "Italy", "Italian");
INSERT INTO "TV_Channel" VALUES ("TVN", "Spain", "Spanish");
INSERT INTO "TV_Channel" VALUES ("CBC", "Canada", "English");
INSERT INTO "TV_Channel" VALUES ("ARD", "Germany", "German");
INSERT INTO "TV_Channel" VALUES ("M6", "France", "French");
INSERT INTO "TV_Channel" VALUES ("ABC", "Australia", "English");
INSERT INTO "Cartoon" VALUES ("1.0", "CNN");
INSERT INTO "Cartoon" VALUES ("2.0", "BBC");
INSERT INTO "Cartoon" VALUES ("3.0", "TF1");
INSERT INTO "Cartoon" VALUES ("4.0", "ZDF");
INSERT INTO "Cartoon" VALUES ("5.0", "NHK");
INSERT INTO "Cartoon" VALUES ("6.0", "CCTV");
INSERT INTO "Cartoon" VALUES ("7.0", "Rai");
INSERT INTO "Cartoon" VALUES ("8.0", "TVN");
INSERT INTO "Cartoon" VALUES ("9.0", "CBC");
INSERT INTO "Cartoon" VALUES ("10.0", "ARD");
INSERT INTO "TV_series" VALUES ("101.0", "CNN");
INSERT INTO "TV_series" VALUES ("102.0", "BBC");
INSERT INTO "TV_series" VALUES ("103.0", "TF1");
INSERT INTO "TV_series" VALUES ("104.0", "ZDF");
INSERT INTO "TV_series" VALUES ("105.0", "NHK");
INSERT INTO "TV_series" VALUES ("106.0", "CCTV");
INSERT INTO "TV_series" VALUES ("107.0", "Rai");
INSERT INTO "TV_series" VALUES ("108.0", "TVN");
INSERT INTO "TV_series" VALUES ("109.0", "CBC");
INSERT INTO "TV_series" VALUES ("110.0", "ARD");
INSERT INTO "TV_series" VALUES ("111.0", "M6");
INSERT INTO "TV_series" VALUES ("112.0", "ABC");