SQL
Examples
Create a simple view:  
```sql
CREATE VIEW v1 AS SELECT * FROM tbl;
```  
Create a view or replace it if a view with that name already exists:  
```sql
CREATE OR REPLACE VIEW v1 AS SELECT 42;
```  
Create a view and replace the column names:  
```sql
CREATE VIEW v1(a) AS SELECT 42;
```  
The SQL query behind an existing view can be read using the [`duckdb_views()` function](#docs:sql:meta:duckdb_table_functions::duckdb_views) like this:  
```sql
SELECT sql FROM duckdb_views() WHERE view_name = 'v1';
```