Question: 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.
 Please complete the following in SQL. Exercises 1. Write a SELECT

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

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!