Previous Topic: Example 2Next Topic: Example 4


Example 3

Alter table ORDERS to prevent the acceptance of any order that would require the financing of a purchase of less than $1000.00.

  1. Require a down payment of 100 percent on orders of less than $1000.00.
  2. Give a meaningful constraint name: ORDERS_MIN_AMT_FINANCED.
     EXEC SQL
          ALTER TABLE ORDERS
            ADD CHECK (GROSS_AMOUNT >= 1000.0 OR PERCENT_DOWN_PMT = 100.0)
            CONSTRAINT ORDERS_MIN_AMT_FINANCED
     END-EXEC