commit e042f9c7e24c0548ea486d2727e8b700dc12bb35 Author: bot50 Date: Mon Apr 13 13:28:47 2026 +0000 daviddoji-cs50/problems/2024/sql/cyberchase@20260413T132847.606975445Z diff --git a/1.sql b/1.sql new file mode 100644 index 0000000..80c7aed --- /dev/null +++ b/1.sql @@ -0,0 +1,2 @@ +-- write a SQL query to list the titles of all episodes in Cyberchase’s original season, Season 1. +SELECT "title" FROM "episodes" WHERE "season" = 1; diff --git a/10.sql b/10.sql new file mode 100644 index 0000000..b50d273 --- /dev/null +++ b/10.sql @@ -0,0 +1,2 @@ +-- write a SQL query to list the ids, titles, and production codes of all episodes. Order the results by production code, from earliest to latest. +SELECT "id", "title", "production_code" FROM "episodes" ORDER BY "production_code" ASC; diff --git a/11.sql b/11.sql new file mode 100644 index 0000000..ae15b56 --- /dev/null +++ b/11.sql @@ -0,0 +1,2 @@ +-- list the titles of episodes from season 5, in reverse alphabetical order. +SELECT "title" FROM "episodes" WHERE "season" = 5 ORDER BY "title" DESC; diff --git a/12.sql b/12.sql new file mode 100644 index 0000000..f05b6ac --- /dev/null +++ b/12.sql @@ -0,0 +1,2 @@ +-- count the number of unique episode titles. +SELECT COUNT(DISTINCT "title") FROM "episodes"; diff --git a/13.sql b/13.sql new file mode 100644 index 0000000..5e0d87f --- /dev/null +++ b/13.sql @@ -0,0 +1,3 @@ +-- write a SQL query to explore a question of your choice. This query should: +-- Involve at least one condition, using WHERE with AND or OR +SELECT "title" FROM "episodes" WHERE "season" = 1 AND "topic" LIKE "%and%" diff --git a/2.sql b/2.sql new file mode 100644 index 0000000..97f1aaa --- /dev/null +++ b/2.sql @@ -0,0 +1,2 @@ +-- list the season number of, and title of, the first episode of every season. +SELECT "season", "title" FROM "episodes" WHERE "episode_in_season" = 1; diff --git a/3.sql b/3.sql new file mode 100644 index 0000000..b95f094 --- /dev/null +++ b/3.sql @@ -0,0 +1,2 @@ +-- find the production code for the episode “Hackerized!”. +SELECT "production_code" FROM "episodes" WHERE "title" = "Hackerized!"; diff --git a/4.sql b/4.sql new file mode 100644 index 0000000..0bd0268 --- /dev/null +++ b/4.sql @@ -0,0 +1,2 @@ +-- write a query to find the titles of episodes that do not yet have a listed topic. +SELECT "title" FROM "episodes" WHERE "topic" IS NULL; diff --git a/5.sql b/5.sql new file mode 100644 index 0000000..b35ca85 --- /dev/null +++ b/5.sql @@ -0,0 +1,2 @@ +-- find the title of the holiday episode that aired on December 31st, 2004. +SELECT "title" FROM "episodes" WHERE "air_date" = "2004-12-31"; diff --git a/6.sql b/6.sql new file mode 100644 index 0000000..58c9dd6 --- /dev/null +++ b/6.sql @@ -0,0 +1,2 @@ +-- list the titles of episodes from season 6 (2008) that were released early, in 2007. +SELECT "title" FROM "episodes" WHERE "season" = 6 AND "air_date" LIKE "2007%"; diff --git a/7.sql b/7.sql new file mode 100644 index 0000000..6a405a2 --- /dev/null +++ b/7.sql @@ -0,0 +1,2 @@ +-- write a SQL query to list the titles and topics of all episodes teaching fractions. +SELECT "title", "topic" FROM "episodes" WHERE "topic" LIKE "%Fractions%"; diff --git a/8.sql b/8.sql new file mode 100644 index 0000000..3858dd0 --- /dev/null +++ b/8.sql @@ -0,0 +1,3 @@ +-- write a query that counts the number of episodes released in the last 6 years, from 2018 to 2023, inclusive. +-- You might find it helpful to know you can use BETWEEN with dates, such as BETWEEN '2000-01-01' AND '2000-12-31'. +SELECT COUNT("title") FROM "episodes" WHERE "air_date" BETWEEN "2018-01-01" AND "2023-12-31"; diff --git a/9.sql b/9.sql new file mode 100644 index 0000000..20a9ae7 --- /dev/null +++ b/9.sql @@ -0,0 +1,2 @@ +-- write a query that counts the number of episodes released in Cyberchase’s first 6 years, from 2002 to 2007, inclusive. +SELECT COUNT("title") FROM "episodes" WHERE "air_date" BETWEEN "2002-01-01" AND "2007-12-31";