
Answer-first summary for fast verification
Answer: DELETE FROM my_table WHERE age > 25;
The correct answer is C because: 1. **DELETE statement**: The DELETE statement is used to remove rows from a table based on a condition. 2. **Condition**: The requirement is to remove rows where `age > 25`, so the WHERE clause should be `WHERE age > 25`. 3. **Other options analysis**: - A: SELECT statement only retrieves data, doesn't modify the table. - B: UPDATE statement modifies existing rows, doesn't delete them. - D: UPDATE statement with wrong condition (would update rows where age <= 25). - E: DELETE statement with wrong condition (would delete rows where age <= 25, opposite of what's needed). In Delta Lake, DELETE operations are fully supported and provide ACID transactions, making option C the correct choice for removing rows where age > 25.
Author: Keng Suppaseth
Ultimate access to all questions.
No comments yet.
Which of the following code blocks will remove the rows where the value in column age is greater than 25 from the existing Delta table my_table and save the updated table?
A
SELECT * FROM my_table WHERE age > 25;
B
UPDATE my_table WHERE age > 25;
C
DELETE FROM my_table WHERE age > 25;
D
UPDATE my_table WHERE age <= 25;
E
DELETE FROM my_table WHERE age <= 25;