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?
UNIQUE
SEQUENCE
AUTO_INCREMENT
None of the above -- Surrogate keys are not implemented in MySQL.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
9 comments Page 1 of 1.

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).

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.

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.

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.

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.

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?

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.

Krishnamoorthy.k said:   1 decade ago
What is the meaning of surrogate keys ?

Divyank said:   1 decade ago
What is the meaning of surrogate keys?

Can anyone tell me?

Post your comments here:

Your comments will be displayed after verification.