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

CREATE TABLE "TV_series" (
"id" FLOAT,
"Episode" TEXT,
"Air_Date" TEXT,
"Rating" 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 ("CH01", "USA");
INSERT INTO "TV_Channel" VALUES ("CH02", "UK");
INSERT INTO "TV_Channel" VALUES ("CH03", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH04", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH05", "Japan");
INSERT INTO "TV_series" VALUES ("101", "A Love of a Lifetime", "2023-05-15", "8.7", "CH01");
INSERT INTO "TV_series" VALUES ("102", "The Great Escape", "2023-05-16", "7.9", "CH02");
INSERT INTO "TV_series" VALUES ("103", "Mystery Night", "2023-05-17", "9.1", "CH03");
INSERT INTO "TV_series" VALUES ("104", "A Love of a Lifetime", "2023-06-01", "8.3", "CH04");
INSERT INTO "TV_series" VALUES ("105", "Final Showdown", "2023-06-05", "8.9", "CH05");
INSERT INTO "TV_series" VALUES ("106", "A Love of a Lifetime", "2023-04-20", "7.5", "CH02");
INSERT INTO "TV_series" VALUES ("107", "Hidden Truths", "2023-05-20", "8.0", "CH01");
INSERT INTO "TV_series" VALUES ("108", "A Love of a Lifetime", "2023-05-15", "8.7", "CH03");