I am taking an Oracle class. One of the assignments is this:

  1. Write an ALTER TABLE statement that adds two new check constraints to the Invoices table of the AP schema. The first should allow: (1) payment_date to be null only if 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.

The problem is the book (Murach's Oracle SQl and PL/SQL) doesn't give any decent examples. Most of the examples are on how to set constraints on primary keys and foreign keys.

Can someone give some examples of what the syntax would be for this type of a constraint?