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

NEED SQL COMMANDS FOR: 1. Using the category table, select the Name and sort by

ID: 3605292 • Letter: N

Question

NEED SQL COMMANDS FOR:

1. Using the category table, select the Name and sort by name in descending order.

2. Using the customer table, select the first and last name of the customers, their email address. Sort by Last name and then First name.

3. 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.

4. 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.

5. 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.

6. Using the rental table, select Rental ID, Rental Date, Inventory ID, Customer ID, and Return Date of all rentals that were rented by customer 12, 19, and 26. Order by Customer ID, then Inventory ID.

7. Using the film-actor table, total all of the films that have been done by actors 8, 15, 27, 31 and 39 (you will get one number).

Explanation / Answer

1. select Name from category order by Name Desc

2.select firstname.lastname,email from customer order by firstname,lastname

3.select Title,Description,RelaseYear,RentalRate,flimlength,Replacecost from flim where flimlength>100 order by flimlength DESC,Title DESC

4.select Payment_ID,Customer_ID,Staff_ID,Rental_ID,Amount,Payment_Date from Payment where Amount>=2.99 order by Customer_ID ASCE,Amount ASCE

5.select Rental_ID, Rental_Date, Inventory_ID, Customer_ID, Return_Date from Rental where Customer_ID=36 order by Inventory_ID

6.select Rental_ID, Rental_Date, Inventory_ID, Customer_ID, and Return_Date where Rental_ID in between(12,19,26) order by Customer_ID,Inventory_ID

7.select count(*) from film_action where ActorID in between(8, 15, 27, 31 ,39 )