
Answer-first summary for fast verification
Answer: `CREATE STREAMING TABLE aggregated_sales AS SELECT store_id, sum(total) FROM LIVE.cleaned_sales GROUP BY store_id`
In Delta Live Tables (DLT) pipelines, the correct syntax to create a table with SQL is `CREATE LIVE TABLE`. To reference another live table within the query, the `LIVE.` keyword must be prepended to the table name. The correct query should be: `CREATE LIVE TABLE aggregated_sales AS SELECT store_id, sum(total) FROM LIVE.cleaned_sales GROUP BY store_id`. This ensures the pipeline can successfully start by properly referencing the live table. Reference: [Delta Live Tables SQL Reference](https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-sql-ref.html).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A data engineer is working on a Delta Live Tables (DLT) pipeline and encounters an error with the following query, preventing the pipeline from starting: CREATE LIVE TABLE aggregated_sales AS SELECT store_id, sum(total) FROM cleaned_sales GROUP BY store_id. What change should be made to this query to successfully start the DLT pipeline?
A
CREATE STREAMING TABLE aggregated_sales AS SELECT store_id, sum(total) FROM LIVE.cleaned_sales GROUP BY store_id
B
CREATE TABLE aggregated_sales AS SELECT store_id, sum(total) FROM LIVE.cleaned_sales GROUP BY store_id
C
CREATE LIVE TABLE aggregated_sales AS SELECT store_id, sum(total) FROM cleaned_sales GROUP BY store_id
D
CREATE STREAMING LIVE TABLE aggregated_sales AS SELECT store_id, sum(total) FROM STREAM(cleaned_sales) GROUP BY store_id
E
CREATE STREAMING LIVE TABLE aggregated_sales AS SELECT store_id, sum(total) FROM cleaned_sales GROUP BY store_id
No comments yet.