The correct answer is B. There can be only one primary key in a data set, whereas there can be multiple unique keys.
A primary key is a column or a set of columns that uniquely identifies each row in a table. A table can have only one primary key, which also enforces the NOT NULL constraint on the column(s) involved.A primary key can also be referenced by a foreign key of another table to establish a relationship between the tables12
A unique key is a column or a set of columns that also uniquely identifies each row in a table, but it is not the primary key. A table can have more than one unique key, which also allows one NULL value for the column(s) involved.A unique key can also be referenced by a foreign key of another table to establish a relationship between the tables12
Some of the differences between a primary key and a unique key are:
A primary key creates a clustered index on the column(s), whereas a unique key creates a non-clustered index on the column(s)3
A primary key does not allow any NULL values, whereas a unique key allows one NULL value for the column(s)123
A primary key can be a unique key, but a unique key cannot be a primary key12
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit