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

CREATE TABLE "TV_Channel" (
"id" TEXT UNIQUE,
"series_name" TEXT,
"Country" TEXT,
PRIMARY KEY ("id")
);

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





INSERT INTO "TV_Channel" VALUES ("CN", "Cartoon Network", "USA");
INSERT INTO "TV_Channel" VALUES ("DIS", "Disney Channel", "USA");
INSERT INTO "TV_Channel" VALUES ("NICK", "Nickelodeon", "USA");
INSERT INTO "TV_Channel" VALUES ("BBC", "BBC One", "UK");
INSERT INTO "TV_Channel" VALUES ("ITV", "ITV", "UK");
INSERT INTO "TV_Channel" VALUES ("TF1", "TF1", "France");
INSERT INTO "TV_Channel" VALUES ("ZDF", "ZDF", "Germany");
INSERT INTO "TV_Channel" VALUES ("ABC", "ABC Kids", "Australia");
INSERT INTO "TV_Channel" VALUES ("CBC", "CBC Kids", "Canada");
INSERT INTO "TV_Channel" VALUES ("TVN", "TVN", "Poland");
INSERT INTO "Cartoon" VALUES ("1.0", "Todd Casey", "CN");
INSERT INTO "Cartoon" VALUES ("2.0", "Genndy Tartakovsky", "CN");
INSERT INTO "Cartoon" VALUES ("3.0", "Todd Casey", "DIS");
INSERT INTO "Cartoon" VALUES ("4.0", "Butch Hartman", "NICK");
INSERT INTO "Cartoon" VALUES ("5.0", "Todd Casey", "BBC");
INSERT INTO "Cartoon" VALUES ("6.0", "Craig McCracken", "CN");
INSERT INTO "Cartoon" VALUES ("7.0", "Todd Casey", "ITV");
INSERT INTO "Cartoon" VALUES ("8.0", "Rebecca Sugar", "CN");
INSERT INTO "Cartoon" VALUES ("9.0", "Todd Casey", "TF1");
INSERT INTO "Cartoon" VALUES ("10.0", "Todd Casey", "ZDF");
INSERT INTO "Cartoon" VALUES ("11.0", "Todd Casey", "ABC");
INSERT INTO "Cartoon" VALUES ("12.0", "Todd Casey", "CBC");
INSERT INTO "Cartoon" VALUES ("13.0", "John Doe", "TVN");
INSERT INTO "Cartoon" VALUES ("14.0", "Jane Smith", "DIS");
INSERT INTO "TV_series" VALUES ("101.0", "2023-01-01", "CN");
INSERT INTO "TV_series" VALUES ("102.0", "2023-01-02", "DIS");
INSERT INTO "TV_series" VALUES ("103.0", "2023-01-03", "NICK");
INSERT INTO "TV_series" VALUES ("104.0", "2023-01-04", "BBC");
INSERT INTO "TV_series" VALUES ("105.0", "2023-01-05", "ITV");
INSERT INTO "TV_series" VALUES ("106.0", "2023-01-06", "TF1");
INSERT INTO "TV_series" VALUES ("107.0", "2023-01-07", "ZDF");
INSERT INTO "TV_series" VALUES ("108.0", "2023-01-08", "ABC");
INSERT INTO "TV_series" VALUES ("109.0", "2023-01-09", "CBC");
INSERT INTO "TV_series" VALUES ("110.0", "2023-01-10", "TVN");