
Answer-first summary for fast verification
Answer: Foreign key constraints are not supported in Delta Lake, so data integrity must be enforced through application logic, which may increase development time and complexity.
### ✅ Correct Answer: **A** **Option A is correct** because Delta Lake does **not enforce foreign key constraints**. While Databricks allows you to *declare* primary and foreign key relationships (with Unity Catalog and supported runtimes), these constraints are **informational only** and do not guarantee data integrity. As a result, enforcing referential integrity must be handled through **application logic, ETL validation, or data quality checks**, which can increase development effort. ### ❌ Why the other options are incorrect - **Option B** is incorrect because no third-party library is required to declare foreign keys; Unity Catalog supports them natively as metadata. - **Option C** is incorrect because foreign key constraints are **not enforced**, even when declared using `ALTER TABLE`. - **Option D** is partially realistic but misleading—workflow-based checks can help, but they still do not provide true constraint enforcement. ### ✅ Key Exam Insight In Databricks, **PK/FK constraints document relationships, they don’t enforce them**. Understanding this distinction is critical for the certification exam.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In the context of data modeling using Delta Lake on Azure Databricks, a data engineer is tasked with designing a solution that ensures data integrity across related tables without relying on application logic. The solution must be scalable, cost-effective, and comply with organizational data governance policies. Considering these constraints, which of the following approaches BEST demonstrates how to implement foreign key constraints in Delta Lake to maintain data integrity? Choose the correct option from the four provided.
A
Foreign key constraints are not supported in Delta Lake, so data integrity must be enforced through application logic, which may increase development time and complexity.
B
Creating a Delta Lake table with foreign key constraints requires integrating a third-party library or external system, potentially introducing additional costs and complexity.
C
Delta Lake supports foreign key constraints natively, which can be defined using the ALTER TABLE statement to ensure data integrity without external dependencies.
D
Foreign key constraints can be simulated in Delta Lake using a combination of MERGE INTO and DELETE statements, but this approach may not fully guarantee data integrity under all scenarios.