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,
"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,
"Air_Date" TEXT,
"Channel" TEXT,
PRIMARY KEY ("id"),
FOREIGN KEY ("Channel") REFERENCES "TV_Channel"("id")
);





INSERT INTO "Cartoon" VALUES ("1", "A Love of a Lifetime", "2005-06-15");
INSERT INTO "Cartoon" VALUES ("2", "The Great Adventure", "2003-09-10");
INSERT INTO "Cartoon" VALUES ("3", "Mystery Island", "2007-11-20");
INSERT INTO "Cartoon" VALUES ("4", "Space Quest", "2005-06-15");
INSERT INTO "Cartoon" VALUES ("5", "Jungle Tales", "2006-01-05");
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", "Japan");
INSERT INTO "TV_series" VALUES ("101", "A Love of a Lifetime", "2005-06-15", "CH1");
INSERT INTO "TV_series" VALUES ("102", "A Love of a Lifetime", "2005-06-16", "CH2");
INSERT INTO "TV_series" VALUES ("103", "The Great Adventure", "2003-09-10", "CH1");
INSERT INTO "TV_series" VALUES ("104", "Mystery Island", "2007-11-20", "CH3");
INSERT INTO "TV_series" VALUES ("105", "Space Quest", "2005-06-15", "CH4");
INSERT INTO "TV_series" VALUES ("106", "Jungle Tales", "2006-01-05", "CH5");
INSERT INTO "TV_series" VALUES ("107", "A Love of a Lifetime", "2005-06-17", "CH3");