Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ For the following exercises, we will be using the `film_list` table. In the SQL
5. Write a query that returns all of the film `genre`s along with their average price and average length.
6. Write a query that returns all of the film `ratings`s along with a count of how many time that rating appears in our table.
7. Instead of us calling films "foreign," write a query that updates all "foreign" films to "international" films.
8. We don't like "childrens" films. Delete all of them from this table.
8. We don't like "childrens" films. Delete all of them from this table.
27 changes: 27 additions & 0 deletions film_list.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SELECT count(fid)
FROM film_list;

SELECT title, description
FROM film_list
ORDER BY length(description) description
LIMIT 1;

SELECT title FROM film_list
min(length)
LIMIT 1;


SELECT title, description
FROM film_list
WHERE actors LIKE '%CAMERON STREEP%';

SELECT category AS "Genre", avg(price) AS "Average Price", avg(length) AS "Average Length"
FROM film_list
GROUP BY category;

SELECT rating AS "Rating", count(rating) AS "Rating Count"
FROM film_list
GROUP BY rating;

UPDATE film_list SET category='International' WHERE category='Foreign';
DELETE FROM film_list WHERE category='Children';