Databricks Data Analyst Associate · Section 4 · 20% of the exam
Create managed tables and external tables, including creating tables by joining data from multiple sources (e.g., CSV, Parquet, Delta tables) to create unified datasets, including Unity Catalog.
One of the objectives of the Databricks Certified Data Analyst Associate exam, in the section “Executing queries using Databricks SQL and Databricks SQL Warehouses”. Here is what it covers, the points to remember and a question to try.
What it covers
Unity Catalog has two kinds of tables: managed tables, where Unity Catalog owns the files, and external tables, where you own them. This lesson covers how to create each, what DROP does, how one CREATE TABLE AS SELECT can unify CSV, Parquet and Delta sources, and how Delta time travel lets you audit, query and restore earlier versions of a table.
Points to remember
- Managed tables are the default and recommended type: no
LOCATION, Delta (or Iceberg), files in Unity Catalog managed storage, eligible for predictive optimization. - External tables use
LOCATIONinside a Unity Catalog external location and needCREATE EXTERNAL TABLE; they support Delta, CSV, JSON, Avro, Parquet, ORC and text. - Dropping a managed table purges its data after a recovery period (7 days by default;
UNDROP TABLE); dropping an external table leaves the files in place. - CTAS derives the schema from the query (no column list);
CREATE OR REPLACEkeeps history and grants;IF NOT EXISTSandOR REPLACEcannot be combined. read_filesreads CSV, Parquet, JSON and other formats from volumes; joining it with Delta tables in one CTAS builds a unified table; it needsREAD VOLUME.
Try a question
A team keeps Parquet files in s3://acme-finance/ledger/, and an external tool must keep writing to that path. An analyst wants to query the files as a Unity Catalog table without moving them. What is required?
- AA managed table created by CTAS from the path, because Unity Catalog can govern only data in managed storage
- BAn external table with
LOCATIONset to that path, inside a Unity Catalog external location - CA foreign catalog created with
CREATE FOREIGN CATALOGon a connection to the S3 bucket - DA volume over the path, followed by
CREATE TABLE ... LOCATION '/Volumes/...'pointing at the volume
Show the answer
B. An external table registers files at a path inside a Unity Catalog external location, which is backed by a storage credential. Creating it requires CREATE EXTERNAL TABLE on the external location, plus the usual USE CATALOG, USE SCHEMA and CREATE TABLE. Unity Catalog governs queries through the table, the files stay where the tool writes them, and dropping the table leaves the files in place.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Managed and External Tables, CTAS and Delta Time Travel teaches this objective (about 45 minutes), and 9 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Utilize Databricks Assistant within a Notebook or SQL Editor to facilitate query writing and debugging.
- Explain the role a SQL Warehouse plays in query execution.
- Querying cross-system analytics by joining data from a Delta table and a federated data source.
- Create a materialized view, including knowing when to use Streaming Tables and Materialized Views, and differentiate between dynamic and materialized views.
- Perform aggregate operations such as count, approximate count distinct, mean, and summary statistics.
- Write queries to combine tables using various join operations (inner, left, right, and so on) with single or multiple keys, as well as set operations like union and union all, including the differences between the joins (inner, left, right, and so on).
- Perform sorting and filtering operations on a table.
- Use Delta Lake's time travel to access and query historical data versions.