DATABRICKS-DATA-ENGINEER-ASSOCIATE practice question 5 of 25
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?
Full set: 177 questionsThe DELETE FROM statement is the correct Data Manipulation Language (DML) command in SQL to remove rows from a Delta table. The WHERE clause is used to specify the condition for deletion. In this case, WHERE age > 25 correctly filters for the rows that need to be removed. This operation is atomic; it removes the specified rows and commits the change as a new version to the Delta table's transaction log, thus saving the updated table state.
A. The SELECT statement only queries and returns data; it does not perform any modification or deletion on the source table.
B. The UPDATE statement is used to modify the values within existing rows, not to remove them. The syntax is also incomplete without a SET clause.
D. The UPDATE statement modifies rows rather than deleting them, and it targets the incorrect set of rows (age <= 25).
E. This DELETE statement uses the incorrect condition (age <= 25), which would remove the rows that should be kept, not the ones specified. ---
1. Databricks SQL Language Reference
DELETE FROM: "Removes the rows that match a predicate." The documentation provides the syntax DELETE FROM tablename [WHERE predicate]
which directly matches the correct answer.
Source: Databricks Documentation > SQL reference > Data manipulation language > DELETE FROM.
2. Databricks Delta Lake Guide
"Table deletes
updates
and merges": "You can remove data that matches a predicate from a Delta table using the DELETE operation. DELETE removes the entire row and does not drop columns." This confirms DELETE is the appropriate operation for removing entire rows based on a condition.
Source: Databricks Documentation > Delta Lake > Delta Lake feature guide > Table deletes
updates
and merges.
Keep practicing
Take the free DATABRICKS-DATA-ENGINEER-ASSOCIATE practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DATABRICKS-DATA-ENGINEER-ASSOCIATE practice questions
- Question 1In which of the following scenarios should a data engineer use the MERGE INTO command ins…
- Question 2Which of the following data workloads will utilize a Gold table as its source?
- Question 3A data engineer has developed a data pipeline to ingest data from a JSON source using Aut…
- Question 4Which two components function in the DB platform architecture’s control plane? (Choose tw…
- Question 7Which of the following statements regarding the relationship between Silver tables and Br…
- Question 8A data organization leader is upset about the data analysis team’s reports being differen…
