Compare commits
10 Commits
3f34ca94a9
...
cs50/probl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5eb6ad1fbc | ||
|
|
2946a3d113 | ||
|
|
3bcd48f745 | ||
|
|
e61ef8e793 | ||
|
|
85f8234017 | ||
|
|
0ed1e13e4a | ||
|
|
609c58b7b3 | ||
|
|
cded6648a5 | ||
|
|
92fc5d8305 | ||
|
|
e520e00101 |
2
10.sql
2
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;
|
||||||
|
|||||||
2
11.sql
2
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;
|
||||||
|
|||||||
2
12.sql
2
12.sql
@@ -0,0 +1,2 @@
|
|||||||
|
-- count the number of unique episode titles.
|
||||||
|
SELECT COUNT(DISTINCT "title") FROM "episodes";
|
||||||
|
|||||||
3
13.sql
3
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%"
|
||||||
|
|||||||
2
6.sql
2
6.sql
@@ -1,2 +1,2 @@
|
|||||||
-- list the titles of episodes from season 6 (2008) that were released early, in 2007.
|
-- list the titles of episodes from season 6 (2008) that were released early, in 2007.
|
||||||
SELECT "title", "air_date" FROM "episodes" WHERE "season" = 6 AND "air_date" LIKE "2007%";
|
SELECT "title" FROM "episodes" WHERE "season" = 6 AND "air_date" LIKE "2007%";
|
||||||
|
|||||||
2
7.sql
2
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%";
|
||||||
|
|||||||
3
8.sql
3
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";
|
||||||
|
|||||||
Reference in New Issue
Block a user