1.) Write a SELECT statement that returns three columns from two tables, all using column aliases:
Vendor - VendorName column
Date - InvoiceDate column
Number - InvoiceNumber column
Sort the final result by Vendor and Date
Hint: Use an INNER JOIN
2.) Write a SELECT statement that returns four columns:
VendorContact (column alias) - From the Vendor table - A concatenation of VendorContactFName and VendorContactLName with a space in between.
InvoiceNumber - From the Invoices table
InvoiceDate - From the Invoices table
Balance - InvoiceTotal minus PaymentTotal and CreditTotal
Sort the final result by Balance, descending. The result set should have a row for each invoice with a non-zero balance.
Hint: Use an INNER JOIN
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |