|
Good point eric!
When you declare a primary key or a unique constraint, Oracle automatically creates a unique index for you to enforce the constraint. As eric pointed out the major difference between primary key and unique constraints is that the latter allows nulls.
It is very common to have a FK in a table pointing to the PK in the same table. One good example is the "emp" table under the "scott" schema when you install the Oracle sample database. Such a relationship is called a recursive relationship, which allows unlimited levels of parent-child relationship.
|