
Databricks Certified Data Engineer - Professional
Get started today
Ultimate access to all questions.
What constraints can be enforced on a Delta table to ensure the integrity of data by preventing the addition of bad data?
What constraints can be enforced on a Delta table to ensure the integrity of data by preventing the addition of bad data?
Real Exam
Explanation:
Delta tables support CHECK
and NOT NULL
constraints to prevent the addition of bad data. These constraints can be added using the ALTER
command. For example: ALTER TABLE routes ADD CONSTRAINT negative_distance CHECK (distance >= 0);
. It's important to note that if the table already contains records that violate the constraint, the command will fail. This ensures that all existing and future data meets the specified conditions.
For more information, refer to the documentation on constraints for Delta tables.