Introduction to databases — Tutorial 4
Learning SQL queries
Exercise
Exercise 1 Write the following SQL queries:
Which last names are not repeated in table actor?
Is a copy of the movie ACADEMY DINOSAUR available for rent from store 1?
Return the title and the release year of all films in one of the following categories: Family, Animation, Documentary.
Tip
You can use the operator IN- Find all customers (id, last name, first name) whose last name starts with the letter L.
Tip
You can use the operator LIKE - Return the total paid by each customer. For each customer, display a single column containing first and last name and another column with the total amount paid. Order the result alphabetically by last name
Tip
You can use the operator CONCATReturn the total revenue from the rentals across the stores in each country. Order by descending revenue.
- The first and last name of the actor that played in the most films. If two or more actors are tied, the query must return the names of all of them.