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

# CREATE VIEW

<a id="sql-create-view" />

Creates a new *virtual table* from the given query.

```sql title="CREATE VIEW Syntax" theme={null}
CREATE [OR REPLACE] VIEW [<schema name>.]<view name> AS
<select statement>
```

When any of the source *tables* of a *view* is altered or dropped, the *view*
will also be dropped.

<Warning>
  A `CREATE OR REPLACE` issues an implicit drop, so *replacing* an
  input *table* will have the same effect on the *view* as dropping it.
</Warning>

## Parameters

<AccordionGroup>
  <Accordion title="OR REPLACE" id="or-replace" defaultOpen>
    Any existing *table*/*view* with the same name will be dropped before creating this *view*
  </Accordion>

  <Accordion title="<schema name>" id="<schema-name>" defaultOpen>
    Name of the *schema* that will contain the created *view*; if no *schema* is specified, the
    *view* will be created in the user's [default schema](/content/concepts/schemas#schema-default)
  </Accordion>

  <Accordion title="<view name>" id="<view-name>" defaultOpen>
    Name of the *view* to create; must adhere to the supported
    [naming criteria](/content/sql/naming#sql-naming-criteria)
  </Accordion>

  <Accordion title="<select statement>" id="<select-statement>" defaultOpen>
    The query that will define both the structure and content of the created *view*
  </Accordion>
</AccordionGroup>

## Examples

To create a view that is a copy of an existing table, failing if a
table or view with the same name as the target view already exists:

```sql CREATE VIEW Example theme={null}
CREATE VIEW example.view_of_table AS
(
    SELECT *
    FROM example.table_to_view
)
```
