Computer Science & Engineering CS 257: Lab Assignment I
A. Write the following queries in an SQL script: (Database to be used: Sakila)
1. How many actors have the last name WOOD? 2. How many actor names (first + last) has all the vowels in them? 3. How many 'Scarlett' and 'Johansson' are there? 4. Which actor has appeared in the most films? 5. How many films are there in each category + language? 6. What is the average length of films by language? 7. What is the average length of a documentary? 8. Did actors called Wahlberg play in any films at all? i. Using EXISTS ii. Using COUNT 9. How many films involve a Crocodile and a Shark? 10. Return the first and last names of actors who played in a film involving a Crocodile and a Shark, along with the release year of the movie, sorted by the actors last names. 11. Find all the film categories in which there are between 55 and 65 films. Return the names of these categories and the number of films per category, sorted by the number of films. 12. Find all films that are have ever been rented. How many are there? 13. How many films are rented out and have not been returned? 14. How many films are overdue? 15. Create a list of currently rented films (limit to 5 sorted by customer_id) 16. Get all overdue DVDs 17. Give an interesting query of your own that is not already in the assignment. The query should involve an aggregation operation, and a nested SELECT.