Sobes.tech
Junior — Middle

What are the limitations imposed on a table when using a primary key?

sobes.tech AI

Answer from AI

A Primary Key in a database table imposes the following constraints:

  • Uniqueness: the values in the primary key column(s) must be unique for each row. This ensures that each record is uniquely identifiable.
  • No NULLs allowed: the primary key column(s) cannot contain NULLs, as the key must always have a value.
  • Indexing: usually, a unique index is created on the primary key, which speeds up searches and ensures data integrity.

These constraints ensure data integrity and allow efficient operations such as selection, updating, and deletion by key.

What are the limitations imposed on a table when… - sobes.tech