DB-TASK-001
Last updated
Last updated
📌 Note: This tutorial uses the dvdrental database. If you dont have the dvdrental, please go through this
Retrieve film titles and their rental rates. Use column aliases to rename title
as "Movie Title" and rental_rate
as "Rate".
List customer names and their email addresses. Alias first_name
and last_name
as "First Name" and "Last Name".
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.
Retrieve actor names sorted by last name, then first name.
List all unique replacement costs from the film
table.
List all films' title
and length
in minutes. Alias length
as "Duration (min)".
Retrieve customer first and last names along with their active
status. Alias active
as "Is Active".
Retrieve the list of film categories sorted alphabetically.
List films by length
, sorted in descending order. Include only the title and length.
Retrieve all actor names, sorted by their first name in descending order.
List all unique ratings
available in the film
table.
Find all unique rental durations from the film
table.
Retrieve the first unique customer ID based on active status. Include the customer_id and active columns, and order by customer_id.
List the earliest rental date for each customer. Include customer_id and rental_date, and order by customer_id.
List the 10 shortest films by length. Include the title and length.
Get the top 5 customers with the highest customer_id. Include the first and last name.
Retrieve all unique values of store_id from the inventory table.
Find all unique replacement_cost values in the film table. Sort the results in ascending order.
List the first rental date for each store. Include store_id and rental_date, and sort by store_id.
Retrieve a list of film ratings sorted alphabetically and include only unique values.
List films by rating
in ascending order and length
in descending order.
Retrieve actor names sorted by last_name in ascending order and first_name in descending order.
List films ordered by replacement_cost
in ascending order and rental_rate
in descending order.
Retrieve customer names sorted by last_name ascending and first_name descending.
List all rentals sorted by customer_id ascending and rental_date descending.
Retrieve a list of films ordered by rental_duration ascending and title descending.