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

CREATE TABLE "TV_series" (
"id" FLOAT,
"Episode" TEXT,
"Rating" TEXT,
"Share" FLOAT,
"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-25");
INSERT INTO "TV_Channel" VALUES ("CH001", "USA");
INSERT INTO "TV_Channel" VALUES ("CH002", "UK");
INSERT INTO "TV_Channel" VALUES ("CH003", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH004", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH005", "Germany");
INSERT INTO "TV_series" VALUES ("101", "Episode 1", "9.5", "25.3", "CH001");
INSERT INTO "TV_series" VALUES ("102", "Episode 2", "8.7", "22.1", "CH002");
INSERT INTO "TV_series" VALUES ("103", "Episode 3", "9.8", "30.0", "CH003");
INSERT INTO "TV_series" VALUES ("104", "Episode 4", "7.9", "18.5", "CH004");
INSERT INTO "TV_series" VALUES ("105", "Episode 5", "9.8", "28.7", "CH005");
INSERT INTO "TV_series" VALUES ("106", "Episode 6", "9.2", "26.4", "CH001");
INSERT INTO "TV_series" VALUES ("107", "Episode 7", "8.5", "20.0", "CH002");
INSERT INTO "TV_series" VALUES ("108", "Episode 8", "9.0", "24.0", "CH003");
INSERT INTO "TV_series" VALUES ("109", "Episode 9", "7.5", "15.0", "CH004");
INSERT INTO "TV_series" VALUES ("110", "Episode 10", "9.8", "29.5", "CH005");