Databricks Certified Data Engineer - Associate

Databricks Certified Data Engineer - Associate

Get started today

Ultimate access to all questions.


The data science team has reported that a column named 'average price' is missing from the 'sales' table. This column can be calculated using the 'units sold' and 'sales amount' columns. Which of the following SQL statements would correctly reload the data with the additional 'average price' column?





Explanation:

The correct answer is C because CREATE OR REPLACE TABLE allows for the modification of the table's schema, including adding new columns. This is essential for adding the 'average price' column. While INSERT OVERWRITE can overwrite data, it does not inherently allow for schema modifications unless specific configurations like spark.databricks.delta.schema.autoMerge.enabled are set to true. The other options either do not support schema modifications or are not the correct syntax for this operation.