1Z0-006 practice question 2 of 10

What is a foreign key in a database?

Full set: 356 questions
Answer options
A: A key that allows access to sensitive data
B: A key that helps establish a relationship between tables Correct answer
C: A key that authorizes foreign users to access the database
D: A key used to open foreign databases
Correct Answer:
B. A key that helps establish a relationship between tables
Explanation

A foreign key is a fundamental concept in relational databases used to establish and enforce a link between the data in two tables. It is a field (or a set of fields) in one table, the child table, that refers to the primary key in another table, the parent table. This constraint ensures referential integrity, meaning that any value in the foreign key column must correspond to an existing value in the parent table's primary key. This mechanism is the cornerstone of creating relationships between entities in a relational database model.

Why Incorrect

A. Access to sensitive data is managed through security privileges and encryption, not foreign keys.
C. Authorization for users, foreign or otherwise, is handled by user accounts, roles, and grants, not data integrity constraints.
D. This statement is technically nonsensical; database links or other middleware are used to connect to different databases.

References

1. Oracle Corporation. (2023). Oracle Database SQL Language Reference, 23c. Chapter 8, "Constraints," Section: "Foreign Key Constraints". The documentation states, "A referential integrity constraint (also called a foreign key constraint) is a rule on a column or set of columns in one table that guarantees that the values in these columns match values in a column in another table."

2. Elmasri, R., & Navathe, S. B. (2016). Fundamentals of Database Systems (7th ed.). Pearson. Chapter 5, "The Relational Data Model and Relational Database Constraints," Section 5.2.3, "Referential Integrity, and Foreign Keys."

3. MIT OpenCourseWare. (2011). 6.830/6.814: Database Systems, Fall 2011. Lecture Notes, "Lecture 2: Relational Model". The notes define a foreign key as a set of attributes in one relation that refers to the primary key of another relation.

Scroll to Top