Examveda

Is duplicate entry of primary key is allowed in SQL?

A. Yes

B. No

C. Depends

D. None of the mentioned

Answer: Option B

Solution (By Examveda Team)

This question is about how primary keys work in SQL (Structured Query Language), which is the language we use to talk to databases.
Think of a primary key as a unique ID for each row in a table. Imagine you have a table of students, and each student has a unique student ID number. That student ID number is the primary key!
Now, can we have two students with the same ID number? No, that would cause confusion.
So, the answer to the question is Option B: No. A primary key must always be unique, meaning you can't have duplicate values for it.
Let's think of it like this: if you have a house address, it should be unique so that the mail carrier can find you correctly. The same goes for primary keys in databases – they need to be unique to identify each row properly.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous