MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A table can have
A
One primary key and more than one candidate key
B
One candidate key and one primary key
C
More than one primary, alternate keys
D
One candidate key only.
Explanation: 

Detailed explanation-1: -One table can only contain a single primary key. It is also a unique type of key that helps in identifying any record on the table uniquely. The difference is that any table can have two or more candidate keys. It is the most crucial part of any table or relation.

Detailed explanation-2: -A primary key is used to uniquely identify a record in a table, while a candidate key helps in selecting the primary key. Another key difference between a primary key and a candidate key is that a table can have only one primary key, but there can be multiple candidate keys.

Detailed explanation-3: -There can be multiple Candidate keys in one table. Each candidate key can qualify as Primary Key. Primary Key is a column or combination of columns that uniquely identify a record. Only one candidate key can be a primary key.

Detailed explanation-4: -A table or relation can contain only one primary key. A table or relation can have more than one candidate key. Any column of a primary key cannot be NULL. The column of a candidate can contain a NULL value.

Detailed explanation-5: -A table can have only ONE primary key; and in the table, this primary key can consist of single or multiple columns (fields).

There is 1 question to complete.