D. Check and not null constraints are not dependent on any structures other than the table
9.
to which they apply and so can safely be copied to a new table.
A, B,C, E. A is wrong because not null and check constraint will be applied to the new
table. B, C, and E are wrong because these constraints need other objects (indexes or a parent
table) and so are not copied.
LAB ANSWER
A possible solution:
This table has a constraint on the ACTIVE column that will permit only Y or N, depending
on whether there is a value in the SUBSCRIBER column. This constraint is too complex to
define in line with the column, because it references other columns. SUBSCRIBER, if not
null, must match a row in SUBSCRIBERS.
The CALLS table:
create table calls
(telno number (7,0) constraint calls_telno_fk references telephones,
starttime date constraint calls_start_nn not null,
endtime date constraint calls_end_nn not null,
constraint calls_pk primary key(telno,starttime),
constraint calls_endtime_ck check(endtime > starttime));
Two constraints are defined at the table level, not the column level. The primary key cannot be
defined in line with a column because it is based on two columns: one telephone can make many
calls, but not two that begin at the same time (at least, not with current technology). The final
constraint compares the start and end times of the call and so cannot be defined in line.