Where to use Primary Key in mySQL?

Joined
Dec 23, 2013
Messages
324
Points
18
Primary is a single unique value which is used to identify in database search results, so that we can simple get our unique value.
Once we write this primary key in mySQL tables then we can write our php code in website.
Every single table in database should contains a primary key.
Primary key is a restriction (condition, limitation or a constraint).
 

AlexBell

New member
Joined
Mar 25, 2014
Messages
22
Points
0
Primary key in that code is create ID column as primary key column. So you can not insert same value which is already exist in that table. SQL just check value when data is inserted into table, if the value is inserted into a primary key column is already exist then SQL cancel insert operation and reject all values.
 
Recommended threads
Replies
8
Views
2,470
Replies
3
Views
4,186
Replies
2
Views
2,959
Top