Database Reference
In-Depth Information
Figure 20.12
Querying
USER_CONSTR
AINTS and
USER_CONS_
COLUMNS.
SONGS table. As shown in Figure 20.11, only the primary key on the
SONGS table remains.
Cascading of constraints can also be applied in the DROP TABLE state-
ment where all dependent constraints in the current and referentially
dependent tables are dropped in order to allow the dropped table to be suc-
cessfully removed. For instance, the DROP TABLE statement that follows
would drop the ARTISTS table plus the foreign key constraint on the
SONGS.ARTIST_ID column and any other related subset foreign key
constraints. This can be verified using the same USER_CONSTRAINTS
query as used in the previous example. (You would have to once again drop
and create the ARTISTS and SONGS tables, including their respective pri-
mary and foreign keys.)
DROP TABLE ARTISTS CASCADE CONSTRAINTS;
Search WWH ::




Custom Search