Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5. Using the customer table, select the First and Last name of the customers, th

ID: 3862349 • Letter: 5

Question

5. Using the customer table, select the First and Last name of the customers, their email address. Sort by Last name and then First name. 6. Using the film table, select the Title, Description, Release Year, Rental Rate, Length and Replacement Cost of all films that are longer than 100 minutes (assuming that length is in minutes). Sort by Length and then Title in descending order. 7. Using the payment table, select the Payment ID, Customer ID, Staff ID, Rental ID, Amount, and Payment Date of all rentals that have a payment amount of 2.99 or greater. Sort by Customer ID, and then Amount in ascending order. 8. Using the rental table, select Rental ID, Rental Date, Inventory ID, Customer ID, and Return Date of all rentals that were rented by customer 36. Order by Inventory ID. 11. Using the payment table find all of the payments made by customer 7 (you will get one number).

Explanation / Answer

5.we use order by to sort basaed on the columns.

select  First _name,Last_name,email_address from customer

order by Last_name,First_name

6. we use ASC for ascending order,DESC for descending order

select the title, description, release year, rental_rate, length ,replacement_cost from film

where lenght>100

order by length ,title DESC;

7.

select the payment_id, customer_id, staff_id, rental_id, amount, payment _date from payment

where amount >=2.99

order by customer_id ,amount ASC;

8.

select rental_id, rental_date, inventory_id, customer_id, return_date from rental wher customer_id=36

order by inventory_id;

11.please provide the table definition,since it says one number,its ambigous if we have to use aggregate sum(amounts) kind of..

Assuming table has oly 2 columns amount and customer_id

select * from payment where customer_id=7;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote