Which type of relationship is represented by a foreign key in a relational database? MCQ with Answer and Explanation

Which type of relationship is represented by a foreign key in a relational database?
A. One-to-one
B. One-to-many
C. Many-to-many
D. All of the above
Answer: Option D
Solution (By JKSSB Mock Tests)
Foreign keys can represent various relationships, including one-to-one, one-to-many, and many-to-many (via junction tables).

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
Which SQL wildcard character is used to match exactly one single character when using the LIKE operator?
A. Asterisk (*)
B. Percentage sign (%)
C. Question mark (?)
D. Underscore (*)

Correct Answer: Option D


Explanation:
In SQL pattern matching with the LIKE operator, the underscore (*) represents exactly one single character, while the percent sign (%) matches zero or more characters.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What is a 'foreign key' constraint specifically designed to prevent?
A. Slow search execution times.
B. Actions that would destroy links or introduce invalid references between tables.
C. The use of duplicate data values within the primary key column.
D. Unauthorized login attempts to the database.

Correct Answer: Option B


Explanation:
A Foreign Key constraint enforces referential integrity, preventing updates or deletions that would leave orphaned child records pointing to non-existent parent rows.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which SQL function returns the current date and time?
A. CURDATE()
B. NOW()
C. GETDATE()
D. All of the above depending on the DBMS

Correct Answer: Option D


Explanation:
Different DBMSs have different functions: MySQL NOW(), SQL Server GETDATE(), etc. But all return current date/time.

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