CertSafari
    Databricks Certified Data Engineer Associate· Lessons

    Domain 7 · Lesson 30/33

    Managed vs External Tables in Unity Catalog: Storage, Formats, Create and Drop

    Differentiate between managed and external tables in Unity Catalog

    16 min read
    3.75% of exam
    8 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    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.

    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.

    Managed, external and foreign tables compared
    FeatureManaged tablesExternal tablesForeign tables
    Data lifecycle managementUnity Catalog managesYou manageExternal system manages
    Storage locationUnity Catalog managesYou specifyExternal system manages
    Automatic optimizationsYesLimitedNo
    Formats supportedDelta Lake, Apache IcebergDelta Lake (recommended), CSV, JSON, AVRO, PARQUET, ORC, TEXTDepends on external system
    Data deleted on DROP TABLEYesNoNo
    Best forProduction workloads, frequently queried dataLegacy integrations, existing dataMigration 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?

    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?

    Sources21345

    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.

    Creating managed tables: no LOCATION clause, Delta by default or Iceberg with USING icebergsql
    -- 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.

    Creating an external table: the LOCATION clause is what makes it externalsql
    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:

    Creating an external table from a DataFrame with the path optionpython
    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>;

    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?

    Sources34

    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.

    Dropping a table by its three-level namesql
    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.

    Setting a recovery period for dropped managed tables on a catalogsql
    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.

    Recovering a dropped table by namesql
    UNDROP TABLE my_catalog.my_schema.my_table;
    Finding dropped tables and their table IDssql
    SHOW TABLES DROPPED IN my_schema;
    Recovering one specific dropped table by its IDsql
    UNDROP TABLE WITH ID '6ca7be55-8f58-47a7-85ee-7a59082fd17a';
    DROP TABLE behavior by table type and metastore
    Table typeMetastoreBehavior
    ManagedUnity CatalogRemoved from the metastore; data marked for deletion; UNDROP possible within the recovery period (default 7 days)
    ManagedHiveRemoved from the metastore and the underlying data is deleted
    ExternalUnity CatalogRemoved from the metastore; data remains; URI access governed by the containing external location
    ExternalHiveRemoved 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?

    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?

    Sources3546

    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.

    Converting an external table to a managed tablesql
    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.

    Rolling a converted table back to an external tablesql
    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?

    Sources783

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 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. 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. 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. 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. 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. 1.
      “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
      “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. 2.
      “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. 3.
      “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. 4.
      “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. 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. 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. 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. 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

    Continue to page 2 of 2

    Convert External Tables to Managed with SET MANAGED, Roll Back, and Modify Tables

    Spotted a mistake, or was something unclear? Tell us.