Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete the following in SQL. Exercises 1. Write a SELECT statement that returns two columns based on the Vendors in this format. table. The

Please complete the following in SQL.
image text in transcribed
Exercises 1. Write a SELECT statement that returns two columns based on the Vendors in this format. table. The first column, Contact, is the vendor contact name in thi first name followed by last initial (for example, "John S.") The second column, Phone, is the VendorPhone column without the area code. Only return rows for those vendors in the 559 area code. Sort the result set by first name, then last name. Write a SELECT statement that returns the InvoiceNumber and balance due for every invoice with a non-zero balance and an InvoiceDueDate that's less than 30 days from today. Modify the search expression for InvoiceDueDate from the solution for exercise 2. Rather than 30 days from today, return invoices due before the last day of the current month. 2. 3. 4. Write a sumimary query WITH CUBE that returns LineltemSum (which is the sum of InvoiceLineltemAmount) grouped by Account (an alias for AccountDescription) and State (an alias for VendorState). Use the CASE and GROUPING function to substitute the literal value "*ALL" for the summary rows with null values. Add a column to the query described in exercise 2 that uses the RANKO function to return a column named BalanceRank that ranks the balance descending order. 5. due in Exercises 1. Write a SELECT statement that returns two columns based on the Vendors in this format. table. The first column, Contact, is the vendor contact name in thi first name followed by last initial (for example, "John S.") The second column, Phone, is the VendorPhone column without the area code. Only return rows for those vendors in the 559 area code. Sort the result set by first name, then last name. Write a SELECT statement that returns the InvoiceNumber and balance due for every invoice with a non-zero balance and an InvoiceDueDate that's less than 30 days from today. Modify the search expression for InvoiceDueDate from the solution for exercise 2. Rather than 30 days from today, return invoices due before the last day of the current month. 2. 3. 4. Write a sumimary query WITH CUBE that returns LineltemSum (which is the sum of InvoiceLineltemAmount) grouped by Account (an alias for AccountDescription) and State (an alias for VendorState). Use the CASE and GROUPING function to substitute the literal value "*ALL" for the summary rows with null values. Add a column to the query described in exercise 2 that uses the RANKO function to return a column named BalanceRank that ranks the balance descending order. 5. due in

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

Understand the different approaches to job design. page 167

Answered: 1 week ago