By 25/02/2016 1 Comments

What Is PRIMARY KEY Constraint In SQL?

  • SQL PRIMARY KEY constraint is used to uniquely identifies each record/row in a database table.
  • When you add SQL PRIMARY KEY┬áto column that column can not contains duplicate and NULL value.


  • SQL PRIMARY KEY constraint prevents duplicate and NULL value insertion in a table column.
  • In database most tables contain a PRIMARY KEY constraint.
  • Each database table can have only one PRIMARY KEY.

Example: MySQL

country_id BIGINT(11) PRIMARY KEY,
country_name VARCHAR(200),
country_location VARCHAR(200) NOT NULL,
country_zipcode INT(60),
UNIQUE (country_zipcode)


  • In above example a PRIMARY KEY is added on country_id column.

Posted in: Sql

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .