MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following attributes can be considered as a choice for a primary key?
A
Name
B
Street
C
RollNo
D
Subject
Explanation: 

Detailed explanation-1: -Which one of the following attribute can be taken as a primary key? Explanation: The attributes name, street and department can repeat for some tuples. But the id attribute has to be unique. So it forms a primary key.

Detailed explanation-2: -A primary key is either an existing table column or a column that is specifically generated by the database according to a defined sequence.

Detailed explanation-3: -Integer (number) data types are the best choice for primary key, followed by fixed-length character data types.

There is 1 question to complete.