Primary Key : Primary Key on a column ensures that no duplicate values are inserted in a column. Also applying primary key ensures null values are not allowed. In terms of indexing, Primary Key enforces Clustered Indexing. It implements the Entity integrity Constraint
Unique Key : Unique is similar to Primary key except that null values are allowed in unique key. Also Non-Clustered indexing is implemented by the unique key constraint.
It implements the Entity integrity Constraint
Foreign Key : Foreign key concept is used to establish relation between two tables of a database . In this relationship , a column which is Primary Key for parent table , is referenced by column of a child table i.e. the two columns are linked to each other. The column which refers the Primary key of parent table , becomes the Foreign key for child table.
No comments:
Post a Comment