Question: Write a SELECT statement that returns the following columns from the invoices table: invoice_number and invoice_total. Additionally, add the following calculations: a. Add payment_total to
Write a SELECT statement that returns the following columns from the invoices table: invoice_number and invoice_total. Additionally, add the following calculations:
a. Add payment_total to credit_total and alias this as payment_credit_total
invoice_total minus payment_total and credit_total and alias this as balance_due
b. Write the same SELECT statement and sort the results by the balance due in descending order.
c. Write the same SELECT statement and add limits the results to the results with the 5 largest balances due.
d. Write the same SELECT statement and add the payment_date column to the SELECT clause.
e. Use a WHERE clause that limits the results to only those rows with a NULL value in the payment_date column
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
