-
Defining Referential Constraints
The following is a brief overview of a coupple of queries I am using to create some tables with constraints. My questions should I switch step 4 and 5?
-----------
Step 1, create the employee table:
Step 2, create the department table:
Step 3, add the constraint to the employee table:
alter table employee
add (constraint empdnoFRK foreign key (dno)
references department (dnumber));
Step 4, enable the constraints:
alter table employee enable constraint empsuperFRK;
alter table department enable constraint departFRK;
Step 5, populate the tables:
-
Why do you need step 4? Constraints are enabled by default.
-- Dilip
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|