Where to use Primary Key in mySQL?

arronmattwills

Well-known member
Registered
Joined
Dec 23, 2013
Messages
191
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).
 

Marc0

Well-known member
Registered
Joined
Jun 6, 2012
Messages
890
Points
28
According to me, Primary Key in mySQL is very important to identify a field as unique for its value, I used to use it for ID field in my mySQL tables.
 

AlexBell

New member
Joined
Mar 25, 2014
Messages
14
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.
 
Latest Threads
Replies
1
Views
24
Replies
0
Views
179
Replies
1
Views
39
Replies
2
Views
81
Recommended Threads
Replies
26
Views
4,625
Replies
6
Views
6,154
Replies
2
Views
3,879
Replies
5
Views
1,239
Similar Threads

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top