Question: 1- Write SQL queries for the following: Find the maximum value of invoice_total and the sum of all invoice_total in the invoices table using a

 1- Write SQL queries for the following: Find the maximum value

1- Write SQL queries for the following: Find the maximum value of invoice_total and the sum of all invoice_total in the invoices table using a single query. Retrieve the invoice_id and invoice_total where invoice total is greater than 1000 dollars but less 10000 dollars and order the invoice_total in descending order. Retrieve the distinct states in the vendors table 2- Write SQL queries for the following: Retrieve the distinct states in the vendors table Retrieve the vendor_id, vendor_name, vendor_city and vendor_state from the vendors tables that are from California (CA), New Jersey (NJ) and New York (NY) 3- Write SQL queries for the following: Retrieve all vendor's city and state where vendor's city contains 'AN' anywhere in the city name Display the vendor_id, invoice_due_date and vendor_phone who have invoice_total greater than 5000 4- Write SQL queries for the following: Retrieve all the invoice ids and invoice_totals that are greater than the maximum invoice_total of vendor whose vendor id is 37 (Hint you could use a subquery here) Create a view that has the following information: a. Vendor's id b. Total dollar value of all invoice per vendor C. Number of invoices per vendor d. latest invoice_due_date per vendor (Hint you would want to use group by to create the view) Write a query against the view to find the vendor with more than 2 invoices

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 Databases Questions!