CA 31 - Select Queries from DVD Rental database
DB-TASK-001
Here LIMIT 10 will be used to limit the number of outputs, so onlly a handy amount of output is displayed due to the usage of Screenshot for the outputs
1. Retrieve film titles and their rental rates. Use column aliases to rename title as "Movie Title" and rental_rate as "Rate".
2. List customer names and their email addresses. Alias first_name and last_name as "First Name" and "Last Name".
3. Get a list of films sorted by rental rate in descending order. If two films have the same rental rate, sort them alphabetically by title.
4. Retrieve actor names sorted by last name, then first name.
5. List all unique replacement costs from the
film table6. List all films'
title and length in minutes. Alias length as "Duration (min)".7. Retrieve customer first and last names along with their
active status. Alias active as "Is Active".9. List films by
length, sorted in descending order. Include only the title and length.10. Retrieve all actor names, sorted by their first name in descending order.
ratings available in the film table.12. Find all unique rental durations from the
film table.13. Retrieve the first unique customer ID based on active status. Include the customer_id and active columns, and order by customer_id.
14. List the earliest rental date for each customer. Include customer_id and rental_date, and order by customer_id.
15 List the 10 shortest films by length. Include the title and length.
16. Get the top 5 customers with the highest customer_id. Include the first and last name.
17. Retrieve all unique values of store_id from the inventory table.
18. Find all unique replacement_cost values in the film table. Sort the results in ascending order.
19. List the first rental date for each store. Include store_id and rental_date, and sort by store_id.
20. Retrieve a list of film ratings sorted alphabetically and include only unique values.
21. List films by
rating in ascending order and length in descending order.22. Retrieve actor names sorted by last_name in ascending order and first_name in descending order.
23. List films ordered by
replacement_cost in ascending order and rental_rate in descending order.24. Retrieve customer names sorted by last_name ascending and first_name descending.
25. List all rentals sorted by customer_id ascending and rental_date descending.
26. Retrieve a list of films ordered by rental_duration ascending and title descending.
Comments
Post a Comment