Question: write and execute the SQL queries that will produce the data (record sets) requested below using the pgAdmin 4 client and the DVD rental database
write and execute the SQL queries that will produce the data (record sets) requested below using the pgAdmin 4 client and the DVD rental database (dvdrental).
1. Using the inventory_id and customer_id fields in the rental table. Write a SQL query that shows the number of DVDs (inventory_id) rented by each customer (customer_id). Only display customers who placed 40 or more orders. Sort the results by the number of DVDs rented in descending order.
2. Using a set of nested subqueries, write a SQL query that returns the first name, last name, and email of customers who rented the film with the title Aladdin Calendar.
3. Using SQL joins, write a SQL query that returns the first name, last name, and email of customers who rented the film with the title Aladdin Calendar.
HINT: You will need 3 explicit joins (i.e. inner joins) in your query.

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
