Database - JDBC, Java Server Pages, and MySQL - Discussion
Discussion Forum : JDBC, Java Server Pages, and MySQL - General Questions (Q.No. 8)
8.
What MySQL property is used to create a surrogate key in MySQL?
Discussion:
9 comments Page 1 of 1.
Divyank said:
1 decade ago
What is the meaning of surrogate keys?
Can anyone tell me?
Can anyone tell me?
Krishnamoorthy.k said:
1 decade ago
What is the meaning of surrogate keys ?
Abhi said:
1 decade ago
A surrogate key is a unique, DBMS-supplied identifier intended to be used as the primary key of a table. Further, the DBMS will not allow the value of a surrogate key to be changed. The values of a surrogate key have no meaning to the users and are usually hidden on forms and reports.
Jyoti chauhan said:
1 decade ago
@Abhi.
I think this is the wrong answer because in your answer you have said that it does not changed but it is created by auto increment property of MySql. So how it was possible?
I think this is the wrong answer because in your answer you have said that it does not changed but it is created by auto increment property of MySql. So how it was possible?
Srikanth said:
9 years ago
The surrogate is internally generated by the system and is invisible to the user or application.
Since there may be several objects in the database corresponding to a single surrogate, we cannot use the surrogate as a primary key; another attribute is required.
Since there may be several objects in the database corresponding to a single surrogate, we cannot use the surrogate as a primary key; another attribute is required.
Gopal Vaghasiya said:
8 years ago
A surrogate key is any column or set of columns that can be declared as the primary key instead of a "real" or natural key.
Sometimes there can be several natural keys that could be declared as the primary key, and these are all called candidate keys. So a surrogate is a candidate key.
Sometimes there can be several natural keys that could be declared as the primary key, and these are all called candidate keys. So a surrogate is a candidate key.
Time said:
8 years ago
A surrogate key (or synthetic key, entity identifier, system-generated key, database sequence number, factless key, technical key, or arbitrary unique identifier[citation needed]) in a database is a unique identifier for either an entity in the modeled world or an object in the database. And it is not derived from Application data.
Rahul said:
7 years ago
Simply surrogate means suppose something is not yours legally but you are behaving like that is your own and simply we can use the same concept in SQL for that we can use AUTO_INCREMENT. Indirectly we are assigning the data by increment but Legally that is not a genuine way to assign the data.
Nikhil patil said:
7 years ago
If you add an extra column to the table to serve the purpose of the primary key, then such a primary key is known as a surrogate key. (because this column has been derived from outside the table).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers