MySQL Constraint

A primary key is a field in a table which uniquely identifies each row/record in a database table.
Properties Primary key: A primary keys must contain:
1)Unique values
2)NOT NULL values.
A table can have only one primary key, which may consist of single or multiple fields.If a table has a primary key defined on any field(s), then you cannot have two records having the same value of that field(s).
A foreign key is a key used to link two tables together.This is sometimes called a referencing key.Foreign Key is a column or a combination of columns whose values match a Primary Key in a different table.
The relationship between 2 tables matches the Primary Key in one of the tables with a Foreign Key in the second table.