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

CREATE TABLE "TV_Channel" (
"id" TEXT,
"Language" TEXT,
PRIMARY KEY ("id")
);

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





INSERT INTO "Cartoon" VALUES ("1", "2023-01-15");
INSERT INTO "Cartoon" VALUES ("2", "2023-02-20");
INSERT INTO "Cartoon" VALUES ("3", "2023-03-10");
INSERT INTO "Cartoon" VALUES ("4", "2023-04-05");
INSERT INTO "Cartoon" VALUES ("5", "2023-05-12");
INSERT INTO "TV_Channel" VALUES ("CH1", "English");
INSERT INTO "TV_Channel" VALUES ("CH2", "Spanish");
INSERT INTO "TV_Channel" VALUES ("CH3", "French");
INSERT INTO "TV_Channel" VALUES ("CH4", "German");
INSERT INTO "TV_Channel" VALUES ("CH5", "Japanese");
INSERT INTO "TV_series" VALUES ("101", "Pilot", "8.5", "2.3", "CH1");
INSERT INTO "TV_series" VALUES ("102", "Finale", "9.7", "3.8", "CH1");
INSERT INTO "TV_series" VALUES ("103", "Episode 3", "7.2", "1.5", "CH2");
INSERT INTO "TV_series" VALUES ("104", "Episode 4", "9.7", "2.9", "CH3");
INSERT INTO "TV_series" VALUES ("105", "Special", "6.8", "1.1", "CH4");
INSERT INTO "TV_series" VALUES ("106", "Episode 2", "8.5", "2.0", "CH5");
INSERT INTO "TV_series" VALUES ("107", "Midseason", "7.2", "1.8", "CH2");
INSERT INTO "TV_series" VALUES ("108", "Episode 5", "9.0", "3.0", "CH3");
INSERT INTO "TV_series" VALUES ("109", "Episode 6", "8.5", "2.5", "CH1");
INSERT INTO "TV_series" VALUES ("110", "Episode 7", "6.8", "1.0", "CH4");