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





INSERT INTO "Cartoon" VALUES ("1", "Adventure Time");
INSERT INTO "Cartoon" VALUES ("2", "The Simpsons");
INSERT INTO "Cartoon" VALUES ("3", "Rick and Morty");
INSERT INTO "Cartoon" VALUES ("4", "Gravity Falls");
INSERT INTO "Cartoon" VALUES ("5", "Steven Universe");
INSERT INTO "TV_Channel" VALUES ("HBO", "USA");
INSERT INTO "TV_Channel" VALUES ("BBC", "UK");
INSERT INTO "TV_Channel" VALUES ("NHK", "Japan");
INSERT INTO "TV_Channel" VALUES ("ZDF", "Germany");
INSERT INTO "TV_Channel" VALUES ("ABC", "Australia");
INSERT INTO "TV_series" VALUES ("101", "A Love of a Lifetime", "8.7", "3", "HBO");
INSERT INTO "TV_series" VALUES ("102", "The Great Escape", "9.1", "1", "BBC");
INSERT INTO "TV_series" VALUES ("103", "Mystery Hour", "7.5", "5", "NHK");
INSERT INTO "TV_series" VALUES ("104", "A Love of a Lifetime", "8.2", "7", "ZDF");
INSERT INTO "TV_series" VALUES ("105", "Final Countdown", "8.9", "2", "ABC");
INSERT INTO "TV_series" VALUES ("106", "A Love of a Lifetime", "7.8", "4", "BBC");
INSERT INTO "TV_series" VALUES ("107", "The Last Stand", "6.9", "10", "HBO");
INSERT INTO "TV_series" VALUES ("108", "A Love of a Lifetime", "9.0", "1", "ABC");