
Answer-first summary for fast verification
Answer: It’s a Delta Lake table. The SELECT statement executes at table creation, storing its output in Delta format on the underlying storage.
The `CREATE TABLE AS SELECT` (CTAS) statement creates a new Delta table and populates it with the results of a SELECT query. The query results are stored in Delta format in the directory of the newly created table. Reference: [AS query clause](https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-table-using.html).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data engineer executes the following CTAS statement in a SQL notebook attached to an All-purpose cluster: CREATE TABLE course_students AS (SELECT c.course_name, t.student_id, t.student_name FROM courses c LEFT JOIN (SELECT s.student_id, s.student_name, e.course_id FROM students s INNER JOIN enrollments e ON s.student_id = e.student_id) t ON c.course_id = t.course_id WHERE c.active = true). What best describes the resulting course_students table?
A
It’s a virtual table with no physical data. The SELECT statement runs each time the course_students table is queried.
B
It’s a Delta Lake table. The SELECT statement executes at table creation, storing its output in Delta format on the underlying storage.
C
It’s a cluster-scoped virtual table. The SELECT statement runs only the first time the table is queried, storing the output in the cluster's memory.
D
It’s a cluster-scoped table. The SELECT statement executes at creation, storing output in the active cluster's memory.
E
It’s a session-scoped table. The SELECT statement executes at creation, storing output in the current Spark session's cache.