1. Write an ALTER TABLE statement that adds two new check constraints to the Invoices tables of the AP Schema. The first should allow (1) payment_date to be null only if the payment_total is zero and (2) payment_date to be not null only if payment_total is greater than zero. The second constraint should prevent the sum of payment_total and credit_total from being greater than invoice_total.
ALTER TABLE invoices ADD CONSTRAINT payment_date_ck check ((payment_date is null) and (payment_total = 0));