> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW CREATE SEMANTIC VIEW

> Return the CREATE SEMANTIC VIEW statement that defines a semantic view.

## Description

Returns the original `CREATE SEMANTIC VIEW` DDL statement that was used to
create the specified semantic view.

## Syntax

```SQL theme={null}
SHOW CREATE SEMANTIC VIEW [<db>.]<view_name>
```

## Parameters

| Parameter | Required | Description |
| - | - | - |
| `db` | No | Database containing the semantic view. Defaults to the current database. |
| `view_name` | Yes | Name of the semantic view. |

## Return value

| Column | Description |
| - | - |
| `Semantic View` | Name of the semantic view. |
| `Create Semantic View` | Full DDL text of the `CREATE SEMANTIC VIEW` statement. |

## Examples

```SQL theme={null}
SHOW CREATE SEMANTIC VIEW sales_db.order_metrics;
```

Sample output:

```
+----------------+--------------------------------------------------------------------+
| Semantic View  | Create Semantic View                                               |
+----------------+--------------------------------------------------------------------+
| order_metrics  | CREATE SEMANTIC VIEW sales_db.order_metrics                        |
|                |   TABLES (                                                         |
|                |     orders   AS sales_db.orders   PRIMARY KEY (o_orderkey),       |
|                |     customer AS sales_db.customer PRIMARY KEY (c_custkey)          |
|                |   )                                                                |
|                |   RELATIONSHIPS (                                                  |
|                |     ord_to_cust AS orders (o_custkey) REFERENCES customer          |
|                |   )                                                                |
|                |   DIMENSIONS (                                                     |
|                |     orders.order_date AS o_orderdate                               |
|                |   )                                                                |
|                |   METRICS (                                                        |
|                |     orders.total_price AS SUM(o_totalprice)                        |
|                |   )                                                                |
+----------------+--------------------------------------------------------------------+
```

## See also

* [CREATE SEMANTIC VIEW](/documents/4.2/sql-reference/sql-statements/semantic-view/CREATE_SEMANTIC_VIEW.md)
* [DROP SEMANTIC VIEW](/documents/4.2/sql-reference/sql-statements/semantic-view/DROP_SEMANTIC_VIEW.md)
* [SHOW SEMANTIC VIEWS](/documents/4.2/sql-reference/sql-statements/semantic-view/SHOW_SEMANTIC_VIEWS.md)
* [Semantic views](/documents/4.2/using_starrocks/semantic_view.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.