Tables and views
Compare tables, views, materialized views, and streaming tables. Select a storage and refresh model for each consumer.
The three-level namespace

samples.nyctaxi.trips. The tree on the left reads catalog (samples), schema (nyctaxi), table (trips). The table page has the tabs Overview, Sample Data, Details, Permissions, History, Lineage, Insights and Quality, and the right panel shows the owner, the type (Managed) and the data source (Delta).Every Unity Catalog object is addressed as catalog.schema.object, for example main.sales.orders. USE CATALOG main; USE SCHEMA sales; sets defaults. Schema and database are synonyms (CREATE SCHEMA = CREATE DATABASE). The legacy per-workspace metastore appears as the catalog hive_metastore.
Each Unity Catalog-enabled workspace has a default catalog (set by an admin). Unqualified names resolve to it unless you run USE CATALOG.
If a statement fails with "the operation attempted to use Hive metastore, which is disabled", no current catalog is set and the workspace has legacy Hive metastore access turned off. Run USE CATALOG main; or fully qualify names.
Managed vs external tables (summary)
| Managed | External | |
|---|---|---|
| Data location | Unity Catalog's managed storage for the metastore, catalog or schema | A path you give with LOCATION, inside a registered external location |
DROP TABLE | Removes the table from the active catalog. Data files are deleted after the configured recovery period (7 days by default). During that period, use UNDROP TABLE. | Deletes metadata only; files remain |
| Formats | Delta (or Iceberg) | Delta, Parquet, CSV, JSON, Avro, ORC, text |
| Optimization | Predictive optimization, automatic features | You manage maintenance |
| Recommended | Yes, the default | When other tools must read the same path or data must stay in a given location |
CREATE TABLE main.sales.orders (id BIGINT, amount DECIMAL(10,2)); -- managed
CREATE TABLE main.sales.orders_ext (id BIGINT, amount DECIMAL(10,2))
LOCATION 's3://acme-data/sales/orders'; -- external
"Unmanaged table" is the older Hive term for an external table. In Unity Catalog a table's storage is either managed or external.
Conversions between them are covered in Unity Catalog.
Tables over files
An external table can sit directly on files in another format:
CREATE TABLE main.raw.orders_csv (id INT, amount DOUBLE)
USING CSV
OPTIONS (header 'true', delimiter ',')
LOCATION 's3://acme-data/raw/orders/'; -- external, non-Delta: no ACID, no time travel
Foreign tables and catalog types
Besides standard catalogs, Unity Catalog has foreign catalogs (Lakehouse Federation) and shared catalogs (Delta Sharing, Unity Catalog). A foreign catalog (Lakehouse Federation) mirrors a database in an external system such as PostgreSQL or Snowflake. Its tables are foreign tables: read-only from Databricks.
| Managed | External | Foreign | |
|---|---|---|---|
| Data lives in | UC managed storage | Your cloud path | The external system |
| Read/write from Databricks | Read and write | Read and write | Read only |
| Automatic optimization | Yes (predictive optimization) | No, you manage it | No |
Comments and generated columns
CREATE TABLE main.sales.tx (
id BIGINT COMMENT 'Transaction id',
amount DECIMAL(10,2) COMMENT 'Amount in EUR'
) COMMENT 'Financial transactions by id';
ALTER TABLE main.sales.tx ALTER COLUMN amount COMMENT 'Amount in EUR, tax included';
Comments appear in Catalog Explorer and help discovery and governance.
Delta generated columns (GENERATED ALWAYS AS (expr)) are always computed on write and stored. There is no VIRTUAL or STORED keyword in Databricks, and the expression must be deterministic, so current_date() cannot be used (an "age" column cannot be generated).
Views
| Object | Stores data? | Lifetime and scope |
|---|---|---|
View CREATE VIEW | No. Saved query, recomputed at each read. | Permanent object in a schema, governed by Unity Catalog |
Temporary view CREATE TEMP VIEW, df.createOrReplaceTempView | No | Current Spark session only (one notebook). Not registered in the catalog. |
Global temporary view CREATE GLOBAL TEMP VIEW | No | All notebooks on the same cluster, until the cluster restarts. Read via global_temp.view_name. Not supported on serverless. |
Materialized view CREATE MATERIALIZED VIEW | Yes, precomputed results | Permanent. Refreshed on a schedule or by a pipeline, incrementally when possible. Runs on serverless. |
Streaming table CREATE STREAMING TABLE | Yes | Permanent Delta table fed by a stream; processes each input row once. Ideal for append-only ingestion. |
CREATE OR REPLACE VIEW main.gold.v_revenue AS
SELECT country, SUM(amount) AS revenue FROM main.silver.orders GROUP BY country;
CREATE MATERIALIZED VIEW main.gold.mv_daily_revenue
SCHEDULE EVERY 1 HOUR
AS SELECT order_date, SUM(amount) AS revenue FROM main.silver.orders GROUP BY order_date;
REFRESH MATERIALIZED VIEW main.gold.mv_daily_revenue;
CREATE OR REFRESH STREAMING TABLE main.bronze.raw_events
SCHEDULE EVERY 15 MINUTES
AS SELECT * FROM STREAM read_files('/Volumes/main/raw/events/', format => 'json');
Metric views
A metric view defines reusable business metrics (measures and dimensions, for example revenue by region) once, centrally, in Unity Catalog, so every dashboard, Genie space and query uses the same definition.
Choosing a gold-layer object New exam
| Need | Choose |
|---|---|
| Always-current logic, cheap to compute, or a security layer over a table | View |
| Expensive aggregation or join read often by dashboards; fresh within a refresh interval | Materialized view |
| Continuous append of new events with low latency, each record processed once | Streaming table |
| Full control of writes (MERGE, custom jobs), or results produced by a job | Table |
- A view stores nothing, so it always shows current data but costs compute at each query.
- A materialized view stores results and can be stale until refreshed. Updates and deletes in the source are reflected at refresh (it recomputes, incrementally when possible).
- A streaming table assumes append-only sources. Updates or deletes in the source do not flow through automatically.
Useful inspection commands
SHOW CATALOGS; SHOW SCHEMAS IN main; SHOW TABLES IN main.sales; SHOW VIEWS IN main.gold;
DESCRIBE TABLE EXTENDED main.sales.orders; -- includes Type: MANAGED / EXTERNAL
SHOW CREATE TABLE main.sales.orders;
COMMENT ON TABLE main.sales.orders IS 'One row per order';
ALTER TABLE main.sales.orders SET TAGS ('domain' = 'sales');
The same commands at schema level, with pattern matching:
DESCRIBE SCHEMA EXTENDED main.todos; -- schema metadata (owner, location, properties); does NOT list tables
SHOW TABLES IN main.todos; -- list tables
SHOW TABLE EXTENDED IN main.todos LIKE 'comp*'; -- details for every table matching a pattern
SHOW CREATE TABLE main.todos.completions; -- reveals identity, defaults and constraints
Choose a dashboard object
A dashboard aggregates 18 months of orders and can be an hour behind. Several teams refresh the same report throughout the day. Which object would avoid rerunning the aggregation on every read?
Check your reasoning
Use a materialized view and schedule a refresh compatible with the freshness target. Reads then use the stored result.
Product reference
Tables and views quiz
Answer 7 questions. Check each answer for an explanation.