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
Retrieve film titles and their rental rates. Use column aliases to rename
title
as "Movie Title" andrental_rate
as "Rate".List customer names and their email addresses. Alias
first_name
andlast_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
andlength
in minutes. Aliaslength
as "Duration (min)".Retrieve customer first and last names along with their
active
status. Aliasactive
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 thefilm
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 andlength
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 andrental_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.
Last updated