# DB-TASK-001

> 📌 Note: This tutorial uses the dvdrental database. If you dont have the dvdrental, please go through this <https://courses.parottasalna.com/database-engineering/sample-databases/dvd-rental-database>

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` table.
6. 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".
8. Retrieve the list of film categories sorted alphabetically.
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.
11. List all unique `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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://courses.parottasalna.com/database-engineering/querying-data/db-task-001.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
