Back to articles
Select Queries from DVD Rental database

Select Queries from DVD Rental database

via Dev.to BeginnersAbirami Prabhakar

1.Retrieve film titles and their rental rates. Use column aliases to rename title as "Movie Title" and rental_rate as "Rate". SELECT title as "Movie Title" , rental_rates as "Rate" FROM film; 2.List customer names and their email addresses. Alias first_name and last_name as "First Name" and "Last Name". SELECT first_name as "First Name", last_name as "Last Name", email FROM customer; 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. SELECT title , rental_rate FROM film ORDER BY title ASC, rental_rate DSC; 4.Retrieve actor names sorted by last name, then first name. SELECT last_name , first_name FROM actor ORDER BY last_name ASC, first_name ASC; 5.List all unique replacement costs from the film table. SELECT DISTINCT replacement_cost FROM film; 6.List all films' title and length in minutes. Alias length as "Duration (min)". SELECT title, length as "Duration(min)" FROM film 7.Retrieve customer first

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
7 views

Related Articles