A data analyst needs to create a new Unity Catalog managed Delta table by combining data from three sources: an existing Delta table registered in Unity Catalog, a CSV file at an external cloud path, and a Parquet file at another external path. Which SQL approach is correct?
Show answer & explanation
Correct answer: A
WHY A: Databricks SQL supports CREATE TABLE AS SELECT (CTAS) that joins multiple sources, including registered Delta tables and files read inline with read_files(). One declarative statement reads the three sources and materializes a single managed Unity Catalog Delta table from heterogeneous inputs. WHY NOT B: CTAS supports multi-source joins, so the one-relation limit is false. A view would also not materialize the data as a managed table. WHY NOT C: A single SELECT can combine sources of different formats, so multi-source CTAS is supported. Sequential INSERT INTO statements are less efficient and require pre-creating an empty table. WHY NOT D: COPY INTO appends files into an existing table; it is not a required command under Unity Catalog and it does not join with other sources or load from a registered table in one operation. WHY NOT E: read_files() works in batch queries, including CTAS, so joins across Delta and file-based sources are handled natively and no ALTER TABLE plus MERGE workaround is necessary.