Question: Write a SELECT statement with CASE functions to return a result set consisting of the following four columns: the InvoiceNumber column from the Invoices table,

Write a SELECT statement with CASE functions to return a result set consisting of the following four columns: the InvoiceNumber column from the Invoices table, the VendorName column from the Vendors table, a string literal indicating the type of invoices with InvoiceType alias, and a string literal indicating which group a vendor belongs with VendorGroup alias.Write a SELECT statement with CASE functions to return a result set

If the InvoiceNumber contains any letter (A-Z), the string literal is Type 1.

If the InvoiceNumber does not contain any letter (A-Z), the string literal is Type 2.

If the VendorName begins with the letter A-M, the string literal is Group 1.

If the VendorName begins with the letter N-Z, the string literal is Group 2.

Sort the final result set by InvoiceType, and then by VendorGroup.

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!