Database - Primary key and Foreign
key - April 01, 2009, 19:10 pm by Nishant Kumar
Define Primary key and Foreign key.
A column or combination of columns that identify a row of data in a table is
A key in a table that identifies records in other table in called a foriegn key.
Primary key and unique key
Both are used to provide uniqueness of the column.
Primary key creates clustered key on the column by default whereas unique key
creates non-clustered index by default.
Primary doesn't allow NULL values whereas unique key can allow one NULL value.
Database - Primary
key and Foreign key - Jan 08, 2010, 15:55 pm by Vidya Sagar
Define Primary key and foreign key.
Primary key is used for unique identification of each row in a table. Unique
and not null values only are accepted to persist in primary key.
Foreign Key identifies a column with the primary key column of another table
(parent table) for storing data. The values in the foreign key must be the
values of primary key of other columns. Thus it ensures the data integrity –