ExamGecko
Question list
Search
Search

List of questions

Search

Question 153 - DA0-001 discussion

Report
Export

Which of the following is a difference between a primary key and a unique key?

A.
A unique key cannot take null values, whereas a primary key can take null values.
Answers
A.
A unique key cannot take null values, whereas a primary key can take null values.
B.
There can be only one primary key in a data set, whereas there can be multiple unique keys.
Answers
B.
There can be only one primary key in a data set, whereas there can be multiple unique keys.
C.
A primary key can take a value more than once, whereas a unique key cannot take a value more than once.
Answers
C.
A primary key can take a value more than once, whereas a unique key cannot take a value more than once.
D.
A primary key cannot be a date variable, whereas a unique key can be.
Answers
D.
A primary key cannot be a date variable, whereas a unique key can be.
Suggested answer: B

Explanation:

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 nonclustered 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

asked 02/10/2024
Tobias Barcelos
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first