What is the outstanding amount for the customer with the customer code 'C00019' in the CUSTOMER table?
{
    "explanation": "I finalized the SQL query by joining the CUSTOMER and ORDERS tables on the CUST_CODE and AGENT_CODE columns, and then joining the resulting table with the AGENTS table on the AGENT_CODE column. I used the CUSTOMER table to filter the customer with the customer code 'C00019' and then used the AGENTS table to calculate the outstanding amount.",
    "query" : "SELECT C.CUST_CODE, C.CUST_NAME, C.CUST_CITY, C.WORKING_AREA, C.CUST_COUNTRY, A.AGENT_NAME, A.AGENT_CODE, A.COMMISSION, A.PHONE_NO, A.COUNTRY, O.ORD_AMOUNT, O.ADVANCE_AMOUNT, O.ORD_DESCRIPTION, O.OUTSTANDING_AMT FROM CUSTOMER C JOIN ORDERS O ON C.CUST_CODE = O.CUST_CODE JOIN AGENTS A ON C.AGENT_CODE = A.AGENT_CODE WHERE C.CUST_CODE = 'C00019' AND O.ORD_AMOUNT > O.ADVANCE_AMOUNT",
    "operation_kind" : "aggregation",
    "schema": "CUSTOMER, ORDERS, AGENTS",
    "confidence" : "100",
    "general_message": "Here is the outstanding amount for the customer with the customer code 'C00019'",
    "main_entity" : "customer"
}