Back to articles
CA - 22

CA - 22

via Dev.to BeginnersAbinaya Dhanraj

Film titles and rental rates SELECT title AS "Movie Title", rental_rate AS "Rate" FROM film; Explanation: Here I am selecting title and rental rate from film table. I used AS to rename the column names for better understanding. Customer names and email SELECT first_name AS "First Name", last_name AS "Last Name", email FROM customer; Explanation: I selected customer name and email. Used alias to display column names properly. Films sorted by rental rate SELECT * FROM film ORDER BY rental_rate DESC, title ASC; Explanation: First sorted by rental rate in descending. If same rate, then sorted by title alphabetically. Actor names sorted SELECT first_name, last_name FROM actor ORDER BY last_name, first_name; Explanation: Sorted actors by last name first, then first name. Unique replacement costs SELECT DISTINCT replacement_cost FROM film; Explanation: Used DISTINCT to remove duplicate replacement costs. Film title and length SELECT title, length AS "Duration (min)" FROM film; Explanation: Se

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
7 views

Related Articles