CompTIA Data+ (DA0-001) — Question 87
Which of the following is a difference between a primary key and a unique key?
Answer options
- 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.
- 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.
Correct answer: B
Explanation
Option B is correct because a primary key uniquely identifies a record in a table and is limited to one per table, while multiple unique keys can exist. Option A is incorrect as a primary key cannot contain null values, while unique keys can. Option C is also wrong since primary keys cannot have duplicate values, and option D is incorrect because both primary keys and unique keys can include date variables.