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

CREATE TABLE "TV_Channel" (
"id" TEXT UNIQUE,
"series_name" TEXT,
"Country" TEXT,
PRIMARY KEY ("id")
);

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





INSERT INTO "Cartoon" VALUES ("1", "Adventure Time");
INSERT INTO "Cartoon" VALUES ("2", "Gravity Falls");
INSERT INTO "Cartoon" VALUES ("3", "Steven Universe");
INSERT INTO "Cartoon" VALUES ("4", "The Amazing World of Gumball");
INSERT INTO "Cartoon" VALUES ("5", "Regular Show");
INSERT INTO "TV_Channel" VALUES ("CN", "Cartoon Network", "USA");
INSERT INTO "TV_Channel" VALUES ("DSNY", "Disney Channel", "USA");
INSERT INTO "TV_Channel" VALUES ("NICK", "Nickelodeon", "USA");
INSERT INTO "TV_Channel" VALUES ("BBC", "BBC One", "UK");
INSERT INTO "TV_Channel" VALUES ("CARTOON", "Cartoon Network UK", "UK");
INSERT INTO "TV_series" VALUES ("101", "The Enchanted Forest", "2023-05-10", "CN");
INSERT INTO "TV_series" VALUES ("102", "A Love of a Lifetime", "2022-11-15", "DSNY");
INSERT INTO "TV_series" VALUES ("103", "Mystery Island", "2023-01-20", "NICK");
INSERT INTO "TV_series" VALUES ("104", "A Love of a Lifetime", "2023-03-05", "BBC");
INSERT INTO "TV_series" VALUES ("105", "Space Adventures", "2023-06-01", "CARTOON");
INSERT INTO "TV_series" VALUES ("106", "A Love of a Lifetime", "2023-07-22", "CN");
INSERT INTO "TV_series" VALUES ("107", "The Lost City", "2023-08-15", "DSNY");
INSERT INTO "TV_series" VALUES ("108", "A Love of a Lifetime", "2023-09-10", "NICK");