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,
"series_name" TEXT,
"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", "Adventure Time");
INSERT INTO "Cartoon" VALUES ("2", "Rick and Morty");
INSERT INTO "Cartoon" VALUES ("3", "Gravity Falls");
INSERT INTO "Cartoon" VALUES ("4", "Steven Universe");
INSERT INTO "Cartoon" VALUES ("5", "The Simpsons");
INSERT INTO "TV_Channel" VALUES ("CH1", "Sky Radio", "USA");
INSERT INTO "TV_Channel" VALUES ("CH2", "Ocean View", "UK");
INSERT INTO "TV_Channel" VALUES ("CH3", "Sky Radio", "Canada");
INSERT INTO "TV_Channel" VALUES ("CH4", "Mountain TV", "Australia");
INSERT INTO "TV_Channel" VALUES ("CH5", "Sky Radio", "USA");
INSERT INTO "TV_series" VALUES ("101", "Pilot", "2023-01-10", "CH1");
INSERT INTO "TV_series" VALUES ("102", "The Beginning", "2023-01-17", "CH1");
INSERT INTO "TV_series" VALUES ("103", "Deep Dive", "2023-02-01", "CH2");
INSERT INTO "TV_series" VALUES ("104", "Sky High", "2023-02-15", "CH3");
INSERT INTO "TV_series" VALUES ("105", "Finale", "2023-03-01", "CH1");
INSERT INTO "TV_series" VALUES ("106", "New Horizons", "2023-03-10", "CH4");
INSERT INTO "TV_series" VALUES ("107", "Return", "2023-03-15", "CH5");
INSERT INTO "TV_series" VALUES ("108", "Climax", "2023-03-20", "CH5");
INSERT INTO "TV_series" VALUES ("109", "Epilogue", "2023-03-25", "CH3");
INSERT INTO "TV_series" VALUES ("110", "Aftermath", "2023-04-01", "CH2");