Unanswered: List customers who have a balance due.
I would greatly appreciate any clarity regarding the following:
I am encountering syntax errors with the code:
mysql> Select CONCAT( FName, ' ', LName ) AS "Customer Name",
TourName AS "Tour Name", TourStartDate AS "Start Date", Cost AS "Tour Cost",
SUM(PaymentAmt) AS "Amount Paid", ( Cost - SUM(PaymentAmt) ) AS "Amount Due"
FROM Customers INNER JOIN Tours INNER JOIN Payments
WHERE NOT EXISTS
( Select Cost FROM Tours
WHERE ( Cost - SUM(PaymentAmt <= 0 ));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at