MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATABASE MANAGEMENT SYSTEM

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Why would you create a primary key?
A
To make each record in a database unique
B
To make each field in a database unique
C
To make each query in a database unique
D
None of the above
Explanation: 

Detailed explanation-1: -The most significant advantages of a primary key are: It uniquely identifies each row of a table. It gets a unique index for each primary key column that helps with faster access.

Detailed explanation-2: -Primary Key(non-null key) is a column of the table that identifies every record that should be unique in the table. The primary Key column should not contain any duplicate values(every column value in the primary key column should be unique), therefore there should only be one primary key column in the table.

Detailed explanation-3: -A primary key is used to ensure data in the specific column is unique. You can only set constraints with primary keys, by setting a foreign key to another column which creates a relationship with the column that has the primary key set. A prime use of a primary key is in the case of a users table.

There is 1 question to complete.