Every Foreign Key is a relationship from one or more columns on the table on which the Foreign Key is declared to a Key on the target table.That’s why it’s called a “Foreign” key: the columns refer to a Key on some other table.This index also permits fast access to data when the primary key is used in queries.If a primary key constraint is defined on more than one column, values may be duplicated within one column, but each combination of values from all the columns in the primary key constraint definition must be unique.Alternatively, you can use deferred constraints as well.
I first learned about this for Oracle, where I learned almost everything I know about Oracle, from the incomparable Tom Kyte. I think the bottom line is that supporting your Foreign Keys with indexes is required to ensure correct behavior of your application if you perform frequent deletes on the referenced table.
Dear tom, please let me know how can i update a record in the primary key field which behaves as a foreign key to other tables without altering (disabling) the primary/foreign constraint????
please reply sooon yours faithfully, SACHIN JAIN for one solution.
It enforces data integrity rules and prohibits modifications that might compromise data integrity.
The foreign key is as important to the database design as the primary key, and together they control updates to the data.