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

CREATE TABLE "TV_Channel" (
"id" TEXT UNIQUE,
"series_name" TEXT,
"Country" TEXT,
"Content" 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 ("CN", "Cartoon Network", "USA", "Animation");
INSERT INTO "TV_Channel" VALUES ("DIS", "Disney Channel", "USA", "Kids");
INSERT INTO "TV_Channel" VALUES ("NICK", "Nickelodeon", "USA", "Kids");
INSERT INTO "TV_Channel" VALUES ("WB", "Warner Bros. Kids", "USA", "Animation");
INSERT INTO "TV_Channel" VALUES ("ANX", "Anime X", "Japan", "Anime");
INSERT INTO "TV_Channel" VALUES ("KIDZ", "Kidz Fun", "UK", "Children");
INSERT INTO "TV_Channel" VALUES ("FAM", "Family Channel", "Canada", "Family");
INSERT INTO "Cartoon" VALUES ("1.0", "Ben 10", "Ben Jones", "CN");
INSERT INTO "Cartoon" VALUES ("2.0", "Teen Titans", "Michael Chang", "CN");
INSERT INTO "Cartoon" VALUES ("3.0", "Powerpuff Girls", "Craig McCracken", "CN");
INSERT INTO "Cartoon" VALUES ("4.0", "Kim Possible", "Steve Loter", "DIS");
INSERT INTO "Cartoon" VALUES ("5.0", "Avatar: The Last Airbender", "Michael Dante DiMartino", "NICK");
INSERT INTO "Cartoon" VALUES ("6.0", "Justice League", "Michael Chang", "WB");
INSERT INTO "Cartoon" VALUES ("7.0", "Dexters Laboratory", "Genndy Tartakovsky", "CN");
INSERT INTO "Cartoon" VALUES ("8.0", "Samurai Jack", "Genndy Tartakovsky", "CN");
INSERT INTO "Cartoon" VALUES ("9.0", "Generator Rex", "Ben Jones", "CN");
INSERT INTO "Cartoon" VALUES ("10.0", "Static Shock", "Michael Chang", "WB");
INSERT INTO "Cartoon" VALUES ("11.0", "The Amazing World of Gumball", "Ben Bocquelet", "CN");
INSERT INTO "Cartoon" VALUES ("12.0", "Scooby-Doo", "Joe Ruby", "WB");
INSERT INTO "Cartoon" VALUES ("13.0", "My Little Pony", "Lauren Faust", "KIDZ");
INSERT INTO "Cartoon" VALUES ("14.0", "Totally Spies!", "David Michel", "FAM");
INSERT INTO "TV_series" VALUES ("101.0", "CN");
INSERT INTO "TV_series" VALUES ("102.0", "DIS");
INSERT INTO "TV_series" VALUES ("103.0", "NICK");
INSERT INTO "TV_series" VALUES ("104.0", "WB");
INSERT INTO "TV_series" VALUES ("105.0", "ANX");
INSERT INTO "TV_series" VALUES ("106.0", "KIDZ");
INSERT INTO "TV_series" VALUES ("107.0", "FAM");