What you will be able to do
- Explain what Unity Catalog controls for a managed table compared with an external table
- Pick the right table type for a given file format and access pattern
- Write CREATE TABLE statements for managed and external tables, and name the extra privilege an external table needs
- Predict what DROP TABLE does to the data files of each table type
- Modify a table with ALTER TABLE, convert an external table to managed with SET MANAGED, and roll it back with UNSET MANAGED
Key concept
Managed vs external table — Unity Catalog governs both kinds of table. For a managed table it also picks where the files are stored and controls what happens to them, including deleting them. For an external table you choose the storage path, and the files' lifecycle stays with you.
1.Governance vs storage: what "managed" actually controls
Every table you register in Unity Catalog is centrally governed. Unity Catalog holds its metadata and controls access, auditing and lineage. That is true for every registered object. The managed/external split comes from a second question: who controls the data files themselves?
For a managed table, Unity Catalog decides where the files go and handles their lifecycle: how they are organized, how they are optimized and when they are deleted. It stores them in the managed storage location defined on the containing schema, catalog or metastore. For an external table, Unity Catalog still governs access, but you set the storage path and you control the file lifecycle. In both cases the files stay in your own cloud account. A managed table does not hand your data over to Databricks.
The managed/external distinction applies only to tables and volumes. Views, models and functions have no managed or external variants.
Volumes follow the same rule as tables. A managed volume has its storage location and file lifecycle controlled by Unity Catalog, and when it is dropped its data files are deleted after a retention period. An external volume is one whose location you set, for example a subpath of an external location, and when it is dropped its data files remain in place.
Checkpoint 1 of 8· Match them up
Match each use of "manage" to its meaning
Tap a term, then the definition that fits it.
Only "managed table" (and managed volume) means Unity Catalog controls the storage location and data lifecycle. Governance applies to every registered object.
“Unity Catalog also controls the underlying storage location (managed storage location) and data lifecycle within your cloud account.”Source: docs.databricks.com
Sources1
2.Formats, optimizations and when to choose each type
Managed tables are the default and recommended type. They use Delta Lake or Apache Iceberg. They get automatic optimization and maintenance, and external clients can reach them through open APIs. The Unity REST API serves Delta clients, and the Iceberg REST Catalog serves Iceberg clients. Both use credential vending, which hands out temporary, scoped credentials that carry the requesting principal's privileges. All reads and writes must use the table name. Path-based access to a managed table is not supported (except in Compatibility Mode), because it would bypass Unity Catalog access controls.
External tables accept a wider range of formats: Delta Lake, CSV, JSON, AVRO, PARQUET, ORC and TEXT. Databricks still recommends Delta for them because it has transactional guarantees. Databricks recommends external tables in two cases. The first is registering existing data that a managed table can't hold, such as JSON or Avro. The second is giving direct access to non-Databricks clients that can't use the other access patterns. That second case has a governance cost: Unity Catalog privileges are not enforced when someone reads the files directly from an external system.
| Feature | Managed tables | External tables | Foreign tables |
|---|---|---|---|
| Data lifecycle management | Unity Catalog manages | You manage | External system manages |
| Storage location | Unity Catalog manages | You specify | External system manages |
| Automatic optimizations | Yes | Limited | No |
| Formats supported | Delta Lake, Apache Iceberg | Delta Lake (recommended), CSV, JSON, AVRO, PARQUET, ORC, TEXT | Depends on external system |
| Data deleted on DROP TABLE | Yes | No | No |
| Best for | Production workloads, frequently queried data | Legacy integrations, existing data | Migration from external systems, temporary access |
Checkpoint 2 of 8· Exam question
A data engineer runs `DROP TABLE finance.sales.transactions_managed` on a managed table in Unity Catalog. What happens to the underlying data files after the command completes?
Correct answer: A — The data files are permanently deleted along with the catalog metadata, because Unity Catalog owns the storage location and lifecycle of a managed table.
- A. Correct. Unity Catalog manages the storage lifecycle of managed tables, so dropping one removes both the catalog entry and the underlying data files.
- B. Incorrect. This describes external table behavior, where only the catalog metadata is removed on drop; a managed table's files are deleted along with it.
- C. Incorrect. Dropping a table removes its transaction log along with the data files rather than preserving a 90-day recoverable history folder.
- D. Incorrect. There is no automatic transfer of files to an external location on drop; the managed table's storage is simply removed.
Checkpoint 3 of 8· Check yourself
A team has a directory of Avro files from a legacy system and wants to register it in Unity Catalog without rewriting it. Which option does Databricks recommend?
Managed tables support only Delta Lake and Iceberg. Registering existing data in an incompatible format such as Avro is the first use case Databricks lists for external tables.
“You need to register a table backed by existing data that isn't compatible with Unity Catalog managed tables, such as JSON or Avro.”Source: docs.databricks.com
3.Creating managed and external tables
The SQL for each type differs by one clause. A managed table needs only a three-level name and a column list. Unity Catalog chooses the storage path. To create one, you need USE CATALOG on the parent catalog, plus USE SCHEMA and CREATE TABLE on the parent schema.
-- Create a managed Delta table
CREATE TABLE <catalog-name>.<schema-name>.<table-name>
(
<column-specification>
);
-- Create a managed table using Iceberg
CREATE TABLE <catalog-name>.<schema-name>.<table-name>
(
<column-specification>
)
USING iceberg;An external table must name its storage location, and that path has to sit inside an external location already registered in Unity Catalog. So you configure the external location first. On top of the three privileges a managed table needs, you also need CREATE EXTERNAL TABLE on the external location that covers the path. Use a separate directory for each table.
CREATE TABLE <catalog>.<schema>.<table-name>
(
<column-name> <data-type>
)
LOCATION 's3://<bucket-path>/<table-directory>';The DataFrame API follows the same pattern. Calling saveAsTable on its own creates a managed table. Adding a path option first makes the table external:
df.write \
.option("path", "s3://<bucket-path>/<table-directory>") \
.saveAsTable("<catalog>.<schema>.<table-name>")Checkpoint 4 of 8· Fill the gap
Which keyword turns this CTAS into an external table?
CREATE TABLE <catalog>.<schema>.<table-name>
? 's3://<bucket-path>/<table-directory>'
AS SELECT * FROM <source-table>;LOCATION sets the storage path. A table created with a path you specify is an external table.
Checkpoint 5 of 8· Check yourself
A user can create managed tables in a schema, but their CREATE TABLE ... LOCATION statement fails. Which privilege are they most likely missing?
They can already create managed tables, so they have USE CATALOG, USE SCHEMA and CREATE TABLE. The one privilege an external table adds is CREATE EXTERNAL TABLE on the external location.
“The CREATE EXTERNAL TABLE privilege on an external location that grants access to the LOCATION accessed by the external table.”Source: docs.databricks.com
4.Dropping a table: where the two types differ most
The command is the same for both types. To run it, you must own the table or hold the MANAGE privilege on it.
DROP TABLE IF EXISTS catalog_name.schema_name.table_name;What happens next depends on the table type. Dropping a managed Unity Catalog table removes it from the metastore and marks its data for deletion. During the recovery period (7 days by default) you can bring it back with UNDROP. After the recovery period ends, an asynchronous purge process deletes the underlying files from your cloud storage. You can set the recovery period at catalog or schema level with RETAIN DROPPED TO: the value is either 0 hours, which disables recovery, or 7 to 30 days. A schema-level setting takes precedence over the catalog's, and a new setting applies only to tables dropped afterwards. Dropping an external table removes only the metadata, and from then on access to that path is governed by the external location that contains it. Deleting the files is your job. The legacy Hive metastore behaves differently: a managed Hive table's data is deleted straight away.
ALTER CATALOG my_catalog RETAIN DROPPED TO 30 DAYS;To recover a dropped table, run UNDROP TABLE with its name. By default it restores the most recently dropped table of that name that you own. The parent schema and catalog must still exist, and table privileges, column spec and properties are recovered. Primary and foreign key constraints are not, so recreate them with ALTER TABLE ADD CONSTRAINT. If several dropped tables share a name, list them with SHOW TABLES DROPPED to find each table ID, then restore a specific one with UNDROP TABLE WITH ID. If a table with that name exists again, rename it first with ALTER TABLE ... RENAME TO.
UNDROP TABLE my_catalog.my_schema.my_table;SHOW TABLES DROPPED IN my_schema;UNDROP TABLE WITH ID '6ca7be55-8f58-47a7-85ee-7a59082fd17a';| Table type | Metastore | Behavior |
|---|---|---|
| Managed | Unity Catalog | Removed from the metastore; data marked for deletion; UNDROP possible within the recovery period (default 7 days) |
| Managed | Hive | Removed from the metastore and the underlying data is deleted |
| External | Unity Catalog | Removed from the metastore; data remains; URI access governed by the containing external location |
| External | Hive | Removed from the metastore; data remains; URI access privileges unchanged |
Checkpoint 6 of 8· Exam question
An analytics team needs a Spark cluster running outside Databricks to read raw Parquet files directly from a specific S3 path they control, independent of any Databricks-managed storage lifecycle. Which Unity Catalog object type should they register the data as?
Correct answer: B — External table
- A. Incorrect. A managed table's files live at a path Unity Catalog controls and manages, which does not fit a requirement to keep data at a path the team specifies and owns.
- B. Correct. An external table stores data at a location the creator specifies and controls in cloud storage, so outside tools can keep reading it independent of Unity Catalog's managed lifecycle.
- C. Incorrect. A streaming table is a Lakeflow Spark Declarative Pipelines construct for incremental processing, not a mechanism for exposing a fixed external storage path.
- D. Incorrect. A materialized view stores precomputed query results rather than raw files at a user-controlled path, so it does not meet this requirement.
Checkpoint 7 of 8· Check yourself
Yesterday an engineer dropped a Unity Catalog managed table by mistake. Nobody has changed the default recovery settings. What is the correct statement?
A dropped managed UC table is only marked for deletion. UNDROP works until the recovery period ends.
“You can UNDROP a managed table within the configured recovery period (default 7 days).”Source: docs.databricks.com
5.Modifying tables: ALTER TABLE, converting to managed and rolling back
You modify a Unity Catalog table with ALTER TABLE. Two examples are changing the owner ([ SET ] OWNER TO principal) and applying tags (SET TAGS, which needs the APPLY TAG permission). The biggest modification that touches the managed/external split is converting an external table into a managed one.
To convert, run ALTER TABLE ... SET MANAGED. It works on Unity Catalog external or foreign Delta Lake tables, and the conversion keeps the table's name, settings, permissions, views and history. For an external table you omit MOVE and COPY, which are only for foreign tables. Before you convert an external table, check the prerequisites: the table must use the Delta Lake format, you must run Databricks Runtime 17.3 LTS or above (or Serverless compute), and you must own the table.
ALTER TABLE main.default.my_external_table SET MANAGED;The conversion can be undone. UNSET MANAGED rolls a converted table back to an external table by pointing its metadata at the original external location. For a converted external table you can roll back within 14 days of conversion.
One more modification matters for external tables. If you change an external table's metadata with a non-Databricks client, or through path-based access from within Databricks, Unity Catalog does not sync automatically. Databricks recommends against such updates. If you do make one, run MSCK REPAIR TABLE <table-name> SYNC METADATA to bring the schema in Unity Catalog up to date.
ALTER TABLE main.default.my_managed_table UNSET MANAGED;Checkpoint 8 of 8· Check yourself
A team converted a Unity Catalog external Delta table to managed with SET MANAGED eight days ago and now wants it back as an external table. What is the correct statement?
UNSET MANAGED points the table metadata back to the original external location, and for a converted external table it works within 14 days of conversion.
“For a converted external table, you can roll back within 14 days of conversion.”Source: docs.databricks.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Dropping an external table also deletes its files from cloud storage.Why is that wrong?
DROP TABLE on an external table removes only the Unity Catalog metadata. To remove the data, you delete the files yourself.
Covered in Dropping a table: where the two types differ most
2.Dropping a managed Unity Catalog table permanently deletes its files the moment the command completes.Why is that wrong?
The data is only marked for deletion. You can UNDROP the table during the recovery period (7 days by default), and the files are purged only after it ends.
Covered in Dropping a table: where the two types differ most
3.A table described as "managed by Unity Catalog" must be a managed table.Why is that wrong?
"Managed by Unity Catalog" means governed, and that covers external tables too. Only a managed table also has its storage location and lifecycle controlled by Unity Catalog.
Covered in Governance vs storage: what "managed" actually controls
4.You need an external table whenever a non-Databricks engine must read the data, because managed tables lock you in.Why is that wrong?
External engines can read, write and create managed tables through open APIs such as the Unity REST API and the Iceberg REST Catalog.
Covered in Formats, optimizations and when to choose each type
5.To convert an external table to managed, you must add MOVE or COPY to SET MANAGED.Why is that wrong?
MOVE and COPY are for foreign tables only. Adding either one to an external table conversion makes the command fail, so you run plain SET MANAGED.
Covered in Modifying tables: ALTER TABLE, converting to managed and rolling back
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.databricks.com/aws/en/data-governance/unity-catalog/managed-versus-externalOfficial docs
“External assets: Unity Catalog controls governance only. The underlying file storage lifecycle is controlled by you or an external system.”
↩︎ Governance vs storage: what "managed" actually controls“Unity Catalog stores managed tables in the managed storage location defined on the containing schema, catalog, or metastore.”
↩︎ Governance vs storage: what "managed" actually controls“The data files always remain in your cloud account.”
↩︎ Governance vs storage: what "managed" actually controls“The distinction between managed and external applies to tables and volumes only.”
↩︎ Governance vs storage: what "managed" actually controls“Data files remain in place”
↩︎ Governance vs storage: what "managed" actually controls“Managed tables use the Delta or Apache Iceberg format.”
↩︎ Formats, optimizations and when to choose each type“Managed assets: Unity Catalog controls both governance (access control, auditing, lineage) and the underlying file storage lifecycle”
↩︎ Key concept“When people say that an object is managed by Unity Catalog, they typically mean that Unity Catalog governs access to it.”
↩︎ Exam trap 3“This means that managed tables do not cause vendor lock-in.”
↩︎ Exam trap 4“Unity Catalog also controls the underlying storage location (managed storage location) and data lifecycle within your cloud account.”
↩︎ Checkpoint“Both managed and external tables support read, write, and create access from external engines via open APIs”
↩︎ Prediction - 2.https://docs.databricks.com/aws/en/tables/typesOfficial docs
“Unity Catalog external tables support the Delta Lake, CSV, JSON, AVRO, PARQUET, ORC, and TEXT formats.”
↩︎ Formats, optimizations and when to choose each type - 3.https://docs.databricks.com/aws/en/tables/externalOfficial docs
“Unity Catalog privileges are not enforced when users access data files from external systems.”
↩︎ Formats, optimizations and when to choose each type“When you define a Unity Catalog external table, you must specify a storage location.”
↩︎ Creating managed and external tables“To drop a table you must be its owner or have the MANAGE privilege on the table.”
↩︎ Dropping a table: where the two types differ most“you must run MSCK REPAIR TABLE <table-name> SYNC METADATA to bring the schema in Unity Catalog up to date.”
↩︎ Modifying tables: ALTER TABLE, converting to managed and rolling back“You must directly delete the underlying data files if you need to remove data associated with the table.”
↩︎ Exam trap 1“You need to register a table backed by existing data that isn't compatible with Unity Catalog managed tables, such as JSON or Avro.”
↩︎ Checkpoint“The CREATE EXTERNAL TABLE privilege on an external location that grants access to the LOCATION accessed by the external table.”
↩︎ Checkpoint“Unity Catalog does not delete the underlying data in cloud storage when you drop an external table.”
↩︎ Prediction - 4.https://docs.databricks.com/aws/en/tables/managedOfficial docs
“Path-based access to Unity Catalog managed tables is not supported (except in Compatibility Mode)”
↩︎ Formats, optimizations and when to choose each type“CREATE TABLE on the table's parent schema.”
↩︎ Creating managed and external tables“After the recovery period ends, an asynchronous purge process deletes the underlying data files from your cloud tenant.”
↩︎ Dropping a table: where the two types differ most - 5.
“The table is removed from the metastore and underlying data is marked for deletion.”
↩︎ Formats, optimizations and when to choose each type“URI access privileges are now governed by the external location that contains the data.”
↩︎ Dropping a table: where the two types differ most“You can UNDROP a managed table within the configured recovery period (default 7 days).”
↩︎ Exam trap 2“You can UNDROP a managed table within the configured recovery period (default 7 days).”
↩︎ Checkpoint - 6.
“If there are multiple dropped relations of the same name, you can use SHOW TABLES DROPPED to identify the table ID”
↩︎ Dropping a table: where the two types differ most“Primary and foreign key constraints are not recovered by the UNDROP command.”
↩︎ Dropping a table: where the two types differ most - 7.
“The conversion retains the table name, settings, permissions, views, and history.”
↩︎ Modifying tables: ALTER TABLE, converting to managed and rolling back“For a converted external table, you can roll back within 14 days of conversion.”
↩︎ Modifying tables: ALTER TABLE, converting to managed and rolling back - 8.
“Format: The table must use the Delta Lake format.”
↩︎ Modifying tables: ALTER TABLE, converting to managed and rolling back“If you add MOVE or COPY options when converting an external table, the command fails with DELTA_ALTER_TABLE_SET_MANAGED_UNSUPPORTED_COPY_MOVE_SYNTAX.”
↩︎ Exam trap 5