Assignments on SQL with Joins
Assignments on SQL with Joins
These questions are for the Sakila database & Tables inside this database.
1. Inner Join:
o Write a query to find the names of customers and the titles of films they have
rented. Use an INNER JOIN between the customer, rental, and inventory
tables.
2. Left Outer Join:
o Write a query to list all customers and their rental history, including customers who
have not rented any films. Use a LEFT JOIN between the customer and rental
tables.
3. Right Outer Join:
o Write a query to list all films and the customers who have rented them, including
films that have not been rented. Use a RIGHT JOIN between the film,
inventory, and rental tables.
4. WHERE Clause:
o Write a query to find the details of rentals that were returned late. Use the rental
and inventory tables and filter by return_date.
o Write a query to find all customers who live in a specific city, e.g., "San Francisco".
Use the customer and address tables.
5. ORDER BY Clause:
o Write a query to list all films in the film table ordered by rental rate in descending
order.
o Write a query to list all customers ordered by their last names in ascending order.
Use the customer table.