
Ultimate access to all questions.
The data engineering team has a large Delta table named ‘users’. A recent query on the table returned some entries with negative values in the ‘age’ column. To enforce data quality, a junior data engineer attempted to add a CHECK constraint with the command: ALTER TABLE users ADD CONSTRAINT valid_age CHECK (age > 0);. However, the command failed. Which statement best explains the cause of this failure?_
A
The users table already exists; CHECK constraints can only be added during table creation using CREATE TABLE command.
B
The users table already contains rows that violate the new constraint; all existing rows must satisfy the constraint before adding it to the table.
C
The users table is not partitioned on the age column. CHECK constraints can only be added on partitioning columns.
D
The users table already contains rows; CHECK constraints can only be added on empty tables.