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 "Cartoon" VALUES ("1.0", "Ben 10", "Ben Jones", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("2.0", "Teen Titans", "Michael Chang", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("3.0", "Justice League", "Ben Jones", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("4.0", "Avatar: The Last Airbender", "Michael Chang", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("5.0", "SpongeBob SquarePants", "Stephen Hillenburg", "Nickelodeon");
INSERT INTO "Cartoon" VALUES ("6.0", "The Powerpuff Girls", "Craig McCracken", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("7.0", "Samurai Jack", "Genndy Tartakovsky", "Adult Swim");
INSERT INTO "Cartoon" VALUES ("8.0", "Dexter's Laboratory", "Genndy Tartakovsky", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("9.0", "Young Justice", "Michael Chang", "Cartoon Network");
INSERT INTO "Cartoon" VALUES ("10.0", "Generator Rex", "Ben Jones", "Cartoon Network");
INSERT INTO "TV_Channel" VALUES ("Cartoon Network", "Cartoon Network Studios", "USA", "Animation");
INSERT INTO "TV_Channel" VALUES ("Nickelodeon", "Nickelodeon Animation Studio", "USA", "Animation");
INSERT INTO "TV_Channel" VALUES ("Disney Channel", "Disney Television Animation", "USA", "Animation");
INSERT INTO "TV_Channel" VALUES ("Adult Swim", "Williams Street", "USA", "Adult Animation");
INSERT INTO "TV_Channel" VALUES ("Boomerang", "Warner Bros. Animation", "USA", "Classic Animation");
INSERT INTO "TV_Channel" VALUES ("Toonami", "Warner Bros. Animation", "USA", "Anime");
INSERT INTO "TV_series" VALUES ("101.0", "Cartoon Network");
INSERT INTO "TV_series" VALUES ("102.0", "Nickelodeon");
INSERT INTO "TV_series" VALUES ("103.0", "Disney Channel");
INSERT INTO "TV_series" VALUES ("104.0", "Adult Swim");
INSERT INTO "TV_series" VALUES ("105.0", "Boomerang");
INSERT INTO "TV_series" VALUES ("106.0", "Toonami");