Primary key and Foreign key

By | January 18, 2014

Primarkey: it will not allow null values,duplicate values,primary key is the unique key of a table.
A primary key is a column or group of columns that uniquely identify a row. Every table should have a primary key. And a table cannot have more than one primary key

Foreign Key: it will allow null values and duplicate values.
A foreign key is a column or set of columns in one table whose values must have matching values in the primary key of another (or the same) table. A foreign key is said to reference its primary key.