The PRIMARY KEY constraint uniquely identifies each record in a database table.
Primary keys must contain unique values.
A primary key column cannot contain NULL values.
Each table should have a primary key, and each table can have only ONE primary key
A FOREIGN KEY in one table points to a PRIMARY KEY in another table.
The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.
The FOREIGN KEY constraint also prevents that invalid data form being inserted into the foreign key column, because it has to be one of the values contained in the table it points to.
Vithal WadjePosted Nov 19, 2012, 5:00 AM
The PRIMARY KEY constraint uniquely identifies each record in a database table.
Primary keys must contain unique values.
A primary key column cannot contain NULL values.
Each table should have a primary key, and each table can have only ONE primary key
A FOREIGN KEY in one table points to a PRIMARY KEY in another table.
The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.
The FOREIGN KEY constraint also prevents that invalid data form being inserted into the foreign key column, because it has to be one of the values contained in the table it points to.
Vishnujeet KumarPosted Nov 9, 2012, 12:08 PM
very good video tutorial.
https://www.youtube.com/watch?v=8iIvyNPwruU
https://www.youtube.com/user/dnfvideo/videos?view=0
Satyapriya NayakPosted Nov 9, 2012, 10:55 AM
http://www.1keydata.com/sql/sql-foreign-key.html
VulpesPosted Nov 9, 2012, 9:20 AM