I have four tables[customer(id, name), sale(customer_id, saleDate), sale_detal(..., totalPrice) and payments(customer_id, sale_id, payAmount, dueAmount)]. for example there