Languages

MySQL - does primary key have to be unique?

0 points
Asked by:
Khloe-Kaiser
458

Does the primary key have to be unique in MySQL?

1 answer
0 points
Answered by:
Khloe-Kaiser
458

Yes, the primary key is always unique in MySQL and every other SQL.

Note:

  • you don't have to explicitly define it as UNIQUE,
  • there can only be one primary key for each table, and it can never be a NULL value.
0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join