Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

Discuss five types of employee training.

Answered: 1 week ago

Question

Identify the four federally mandated employee benefits.

Answered: 1 week ago