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", "Sky Radio");
INSERT INTO "Cartoon" VALUES ("2", "Ocean Adventures");
INSERT INTO "Cartoon" VALUES ("3", "Mountain Quest");
INSERT INTO "Cartoon" VALUES ("4", "City Lights");
INSERT INTO "Cartoon" VALUES ("5", "Desert Storm");
INSERT INTO "TV_Channel" VALUES ("CH1", "Sky Radio", "USA");
INSERT INTO "TV_Channel" VALUES ("CH2", "Ocean Adventures", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH3", "Mountain Quest", "UK");
INSERT INTO "TV_Channel" VALUES ("CH4", "City Lights", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH5", "Desert Storm", "USA");
INSERT INTO "TV_Channel" VALUES ("CH6", "Sky Radio", "UK");
INSERT INTO "TV_series" VALUES ("101", "Episode 1", "2023-01-10", "CH1");
INSERT INTO "TV_series" VALUES ("102", "Episode 2", "2023-01-17", "CH1");
INSERT INTO "TV_series" VALUES ("103", "Episode 1", "2023-02-05", "CH2");
INSERT INTO "TV_series" VALUES ("104", "Episode 3", "2023-01-24", "CH1");
INSERT INTO "TV_series" VALUES ("105", "Episode 1", "2023-03-01", "CH3");
INSERT INTO "TV_series" VALUES ("106", "Episode 1", "2023-01-15", "CH6");
INSERT INTO "TV_series" VALUES ("107", "Episode 2", "2023-01-22", "CH6");
INSERT INTO "TV_series" VALUES ("108", "Episode 3", "2023-01-29", "CH6");
INSERT INTO "TV_series" VALUES ("109", "Episode 4", "2023-02-05", "CH6");
INSERT INTO "TV_series" VALUES ("110", "Episode 1", "2023-04-01", "CH4");
INSERT INTO "TV_series" VALUES ("111", "Episode 1", "2023-05-01", "CH5");