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.