A database administrator is tasked with designing a new table in a relational database that holds customer account information. The administrator must ensure that every row in the table has a unique, non-null identifier for each customer. Which type of constraint should the administrator use to enforce this rule?
The correct answer is Primary key constraint. A primary key constraint uniquely identifies each row in a database table and cannot be null. It is used to enforce the uniqueness of the row data and serve as an identifier for referencing the rows. A Unique constraint ensures that all values in a column are different but does not prevent null entries. Foreign key constraint is utilized to maintain the referential integrity between two tables, not for uniqueness within one table. The Check constraint is used to specify a predicate that all tuples must satisfy, but it does not enforce uniqueness nor prevent nulls by itself.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a primary key constraint?
Open an interactive chat with Bash
What is the difference between a primary key and a unique constraint?