What is the purpose of a Foreign Key? MCQ with Answer and Explanation

What is the purpose of a Foreign Key?
A. To sort data
B. To create indexes
C. To uniquely identify records
D. To link two tables and enforce referential integrity
Answer: Option D
Solution (By JKSSB Mock Tests)
A foreign key establishes a relationship between tables and maintains referential integrity.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
Which of the following is a characteristic of a view?
A. It is always faster than a table
B. It stores data physically
C. It is a virtual table based on a query
D. It cannot be updated

Correct Answer: Option C


Explanation:
A view is a virtual table that does not store data physically; it presents data from one or more tables as if it were a table.

This question belongs to: Computer Database Management System (DBMS)
Question #2
Which type of join returns all rows from the left table and matching rows from the right table?
A. INNER JOIN
B. FULL JOIN
C. LEFT JOIN
D. RIGHT JOIN

Correct Answer: Option C


Explanation:
LEFT JOIN (or LEFT OUTER JOIN) returns all rows from the left table, with matching rows from the right table; NULLs appear when no match.

This question belongs to: Computer Database Management System (DBMS)
Question #3
What is a primary key in a database table?
A. A key that uniquely identifies each row in a table
B. A key that references a column in another table
C. A key that can contain duplicate values
D. A key that is always numeric

Correct Answer: Option A


Explanation:
A primary key is a column or set of columns that uniquely identifies each row in a table, ensuring entity integrity.

This question belongs to: Computer Database Management System (DBMS)