MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Primary key should be chosen such that it’s attribute vales are never
A
Updated
B
Changed
C
Dependent
D
None of these
Explanation: 

Detailed explanation-1: -The primary key should be chosen such that its attributes are never, or very rarely, changed. For instance, the address field of a person should not be part of the primary key, since it is likely to change.

Detailed explanation-2: -To qualify as a primary key for an entity, an attribute must have the following properties: It must have a non-null value for each instance of the entity. The value must be unique for each instance of an entity. The values must not change or become null during the life of each entity instance.

Detailed explanation-3: -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-4: -A primary key is the column or columns that contain values that uniquely identify each row in a table. A database table must have a primary key for Optim to insert, update, restore, or delete data from a database table.

There is 1 question to complete.