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", "Rick and Morty");
INSERT INTO "Cartoon" VALUES ("4", "Steven Universe");
INSERT INTO "Cartoon" VALUES ("5", "The Simpsons");
INSERT INTO "TV_Channel" VALUES ("CH01", "Global Entertainment", "USA");
INSERT INTO "TV_Channel" VALUES ("CH02", "Sunrise Network", "UK");
INSERT INTO "TV_Channel" VALUES ("CH03", "Star Vision", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH04", "Prime TV", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH05", "Metro Broadcast", "USA");
INSERT INTO "TV_series" VALUES ("101", "A Love of a Lifetime", "2023-05-10", "CH01");
INSERT INTO "TV_series" VALUES ("102", "The Final Quest", "2023-06-15", "CH02");
INSERT INTO "TV_series" VALUES ("103", "Mystery Hour", "2023-07-20", "CH03");
INSERT INTO "TV_series" VALUES ("104", "A Love of a Lifetime", "2023-08-25", "CH04");
INSERT INTO "TV_series" VALUES ("105", "Hidden Truths", "2023-09-30", "CH05");
INSERT INTO "TV_series" VALUES ("106", "A Love of a Lifetime", "2023-10-05", "CH05");
INSERT INTO "TV_series" VALUES ("107", "The Last Stand", "2023-11-10", "CH01");
INSERT INTO "TV_series" VALUES ("108", "New Beginnings", "2023-12-15", "CH02");