Databricks Data Engineer Professional exam dumps

Databricks Data Engineer Professional practice question 176 of 313

Databricks Certified Data Engineer Professional. Professional level, Databricks. Free question with the correct answer and a full explanation.

Databricks Data Engineer Professional Question 176

Single answer

You are designing a Delta Lake table to store sales transaction data. To ensure data integrity, you want to prevent any records with negative transaction amounts from being written to the table. Which approach would you use to enforce this constraint in Delta Lake?

  1. A

    Use a CHECK constraint on the Delta Lake table to ensure transaction amounts are non-negative.

  2. B

    Use a NOT NULL constraint on the transaction amount column.

  3. C

    Create a trigger to automatically delete records with negative transaction amounts.

  4. D

    Write a Delta Live Table (DLT) pipeline with quality rules to filter out invalid data.

Show answer and explanation

Correct answer: A

Explanation

Delta Lake supports CHECK constraints, which are used to enforce specific rules on the data at the table level. By using a CHECK constraint, you can ensure that only valid data (e.g., non-negative transaction amounts) is written to the table, directly addressing the requirement in the scenario. Other options, such as NOT NULL constraints, triggers, or Delta Live Table pipelines, either do not apply to Delta Lake or do not directly enforce constraints on the table itself.

  • A. Correct.

    This is correct. Delta Lake supports CHECK constraints, which allow you to enforce rules on the data being written to the table, such as ensuring transaction amounts are non-negative.

  • B. Incorrect.

    This is incorrect. A NOT NULL constraint ensures that a column cannot have null values but does not prevent negative values in the transaction amount column.

  • C. Incorrect.

    This is incorrect. Delta Lake does not support triggers like traditional relational databases. This approach is not applicable in this scenario.

  • D. Incorrect.

    This is incorrect. While Delta Live Tables (DLT) can enforce quality rules, the question specifically asks about adding constraints to the Delta Lake table itself, not implementing a separate pipeline.

Timed practice exam

Take a Databricks Data Engineer Professional practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam