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.

write and execute the SQL queries that will

category * category_id name last_update inventory * inventory_id film_id store_id last_update customer * customer_id store_id first_name last_name email address_id activebool create_date last_update active film_category *film_id * category_id last_update rental * rental_id rental_date inventory_id customer_id return_date staff_id last_update Ho Ith film * film_id title description release_year language_id rental_duration rental_rate length replacement_cost rating last_update special_features fulltext address * address_id address address2 district city_id postal_code phone last_update payment * payment_id customer_id staff_id rental_id amount payment_date city * city_id city country_id last_update ++ language * language_id name last_update staff staff_id first_name last_name address_id email store_id active username password last_update picture country * country_id country last_update * film_actor * actor_id * film_id last_update Ho actor actor_id first_name last_name last_update store store_id manager_staff_id address_id last_update et

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!