Home | Previous Page | Next Page   Appendix B. Demonstration SQL > SQL Files for the Relational Database Model >

alt_cat.sql

The following command file alters the catalog table. It drops the existing constraint aa on the catalog table and adds a new constraint, ab, which specifies cascading deletes. You can use this command file and then the del_stock.sql command file for practice with cascading deletes on a database with logging.

ALTER TABLE catalog DROP CONSTRAINT aa;

ALTER TABLE catalog ADD CONSTRAINT
   (FOREIGN KEY (stock_num, manu_code) REFERENCES stock
    ON DELETE CASCADE CONSTRAINT ab);
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]