Title: Exam 1
Course: COP 2842 Internet Programming

Q: Display all columns from the Vendors table for those vendors that are located in New Jersey and have a value in the VendorPhone column (hint: not a null).  Order the results by VendorName in ascending order.

Q: Display the VendorID, VendorName, and the contact name (show the contact name as the VendorContactLName concatenated to the vendorcontactFName separated by a comma.).  Only show those vendors that have the word “electric” somewhere in the VendorName.  Order the results by VendorContactLName in ascending order and then VendorContactFName in ascending order.

Q: Display only the top 3 InvoiceID and InvoiceTotal from the Invoices table based on the InvoiceTotal.   In other words, the 3 most expensive invoices only.  Order the results in descending order by InvoiceTotal.

Q: Display VendorName’s from the Vendors table and any associated InvoiceID’s from the Invoices table.  Show VendorName’s even if they do not have any associated invoices.  Order the results by VendorName in ascending order.

Q: Modify your answer to Problem #4 to show only those vendors that do not have an associated invoice.

Q: Display the VendorName and the AccountNo from the InvoiceLineItem table for all InvoiceLineItem’s.  Order to results by VendorName in ascending order and then AccountNo in ascending order.

Q: Display the VendorName and VendorState from the Vendors table for all vendors located in Florida, followed by those vendors located in Georgia using a SET operator.

Q: Display the InvoiceID and the # of InvoiceLineItem’s for each invoice.  Use an appropriate alias for the summary column.

Q: Display InvoiceID’s from the Invoices table and the sum of the associated InvoiceLineItemAmounts’s from the InvoiceLineItems table.  Only show those invoices where the sum of InvoiceLineItemAmounts is more than $10,000.  Order the results in descending order by the sum of the InvoiceLineItemAmount’s.

Q: Display the InvoiceID from the Invoices table that has the highest InvoiceTotal using a subquery.