2. Write a SELECT statement that returns four columns:
VendorName - From the Vendors table
InvoiceDate - From the Invoices table
Balance - InvoiceTotal minus the sum of Payment Total and CreditTotal

The result set should have one row for each invoice with a non-zero balance. Sort the result set by VendorName in ascending order.

4. Generate the same result set described in exercise 2, but use the implicite join syntax.

5. Write a SELECT statement that returns five columns from three tables, all using column aliases:
Vendor - VendorName column
Date - InvoiceDate column
# - InvoiceSequence column
Lineltem - InvoiceLineItemAmount column

Assign the following correlation names to the tables:
Vendors table
Invoices table
InvoiceLineItems table

Sort the final result set by Vendor, Date, Number, and #.

7. Write a SELECT statement that returns two columns from the GLAccounts table: AccountNo and AccountDescription. The result set should have one row for each account number that has never been used. Sort the final result set by AccountNo.

Hint: Use an outer join to the InvoiceLineItems table.

8. Use the UNION operator to generate a result set consisting of two columns from the Vendors table: VendorName and VendorState. If the vendor is in California, the VendorState value should be "CA"; otherwise, the VendorState value should be "Outside CA." Sort the final result set by VendorName.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.