
Answer-first summary for fast verification
Answer: The table will be deleted from the catalog, and the associated data files will be permanently removed from storage.
The table `test.store_wise_sales` is a **managed table** because it was created without a `LOCATION` clause. For managed Delta tables, the `DROP TABLE` command performs two actions: 1. It removes the table's metadata from the metastore (catalog). 2. It physically deletes the directory and all associated data files from the underlying storage (e.g., DBFS or S3). **Why other options are incorrect:** * **Option A:** Databricks SQL executes DDL statements immediately; there is no manual transaction management or `COMMIT` required for dropping tables. * **Option B:** This behavior applies only to **external tables**. If a `LOCATION` had been specified, only the catalog entry would be removed. * **Option D:** Databricks allows dropping any table provided the user has sufficient permissions; there is no built-in prohibition specifically for 'production' data. * **Option E:** Once a managed table is dropped, its entire directory (including the `_delta_log`) is deleted. Therefore, the data cannot be queried via Time Travel because the transaction log no longer exists. Note: In Unity Catalog, an `UNDROP` command might be available within a short retention window, but the standard Delta Lake behavior is full deletion.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A Delta Lake table named store_wise_sales was created in the test schema using the following SQL statement:
CREATE TABLE test.store_wise_sales AS (
SELECT *
FROM test.sales a
INNER JOIN test.store b
ON a.store_id = b.store_id
);
CREATE TABLE test.store_wise_sales AS (
SELECT *
FROM test.sales a
INNER JOIN test.store b
ON a.store_id = b.store_id
);
If a workspace administrator executes the command DROP TABLE test.store_wise_sales, what will be the outcome?
A
No action will take place until a COMMIT command is explicitly executed.
B
The table will be removed from the catalog, but the underlying data files will persist in storage.
C
The table will be deleted from the catalog, and the associated data files will be permanently removed from storage.
D
An error will occur because Delta Lake prevents the deletion of tables containing production data.
E
The data will be marked as deleted in the transaction log but will still be retrievable using Delta Lake Time Travel.