Question: SQL Write a SELECT statement that returns four columns: VendorName From the Vendors table InvoiceNumber From the Invoice table InvoiceDate From the Invoice table Balance
SQL
Write a SELECT statement that returns four columns: VendorName From the Vendors table InvoiceNumber From the Invoice table InvoiceDate From the Invoice table Balance InvoiceTotal minus the sum of PaymentTotal 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. Here is result set with 11 rows:

Balance VendorName Invoice Num... InvoiceDate 547480102 2012-04-01 00:00:00 224.00 Blue Cross 2 Cardinal Business Media Inc. 134.116 2012-03-28 00:00:00 90.36 2012-03-10 00:00:00 85.31 Data Reproductions Corp 39104 4 Federal Express Corporation 963253264 2012-03-18 00:00:00 52.25 5 Federal Express Corporation 263253268 2012-03-21 00:00:00 59.97 6 Federal Express Corporation 263253270 2012-03-22 00:00:00 67.92 7 Federal Express Corporation 263253273 2012-03-22 00:00:00 30.75 Ford Motor Credit Company 9982771 2012-03-24 00:00:00 503.20 9 Ingram 31361833 2012-03-21 00:00:00 579.42 2012-03-31 00:00:00 10976.06 10 Malloy Lithographing Inc 0-2436 2012-03-23 00:00:00 19351.18 P-0608 11 Malloy Lithographing Inc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
