What is the difference between primary
, unique
and foreign key constraints
, and indexes
?
I work on Oracle 10g<
Here are some reference for you:
Primary & foreign key Constraint.
Primary Key: A primary key is a field or combination of fields that uniquely identify a record in a table, so that an individual record can be located without confusion.
Foreign Key: A foreign key (sometimes called a referencing key) is a key used to link two tables together. Typically you take the primary key field from one table and insert it into the other table where it becomes a foreign key (it remains a primary key in the original table).
Index, on the other hand, is an attribute that you can apply on some columns so that the data retrieval done on those columns can be speed up.