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,
"Country" 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", "2020-01-15");
INSERT INTO "Cartoon" VALUES ("2", "2021-05-20");
INSERT INTO "Cartoon" VALUES ("3", "2019-11-10");
INSERT INTO "Cartoon" VALUES ("4", "2022-07-30");
INSERT INTO "Cartoon" VALUES ("5", "2018-03-25");
INSERT INTO "TV_Channel" VALUES ("CH1", "USA");
INSERT INTO "TV_Channel" VALUES ("CH2", "UK");
INSERT INTO "TV_Channel" VALUES ("CH3", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH4", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH5", "Germany");
INSERT INTO "TV_series" VALUES ("101", "Pilot", "9.5", "3.2", "CH1");
INSERT INTO "TV_series" VALUES ("102", "Finale", "9.7", "4.1", "CH2");
INSERT INTO "TV_series" VALUES ("103", "Midseason", "9.6", "2.9", "CH3");
INSERT INTO "TV_series" VALUES ("104", "Special", "8.9", "3.5", "CH4");
INSERT INTO "TV_series" VALUES ("105", "Episode 5", "7.8", "1.8", "CH5");
INSERT INTO "TV_series" VALUES ("106", "Episode 6", "9.7", "3.9", "CH1");
INSERT INTO "TV_series" VALUES ("107", "Episode 7", "9.4", "2.5", "CH2");
INSERT INTO "TV_series" VALUES ("108", "Episode 8", "9.3", "2.7", "CH3");
INSERT INTO "TV_series" VALUES ("109", "Episode 9", "9.7", "4.0", "CH4");
INSERT INTO "TV_series" VALUES ("110", "Episode 10", "8.5", "1.9", "CH5");