SQL
`CREATE TABLE ... AS SELECT` (CTAS)
DuckDB supports the `CREATE TABLE ... AS SELECT` syntax, also known as “CTAS”:  
```sql
CREATE TABLE nums AS
SELECT i
FROM range(0, 3) t(i);
```  
This syntax can be used in combination with the [CSV reader](#docs:data:csv:overview), the shorthand to read directly from CSV files without specifying a function, the [`FROM`-first syntax](#docs:sql:query_syntax:from), and the [HTTP(S) support](#docs:extensions:httpfs:https), yielding concise SQL commands such as the following:  
```sql
CREATE TABLE flights AS
FROM 'https://duckdb.org/data/flights.csv';
```  
The CTAS construct also works with the `OR REPLACE` modifier, yielding `CREATE OR REPLACE TABLE ... AS` statements:  
```sql
CREATE OR REPLACE TABLE flights AS
FROM 'https://duckdb.org/data/flights.csv';
```  
Note that it is not possible to create tables using CTAS statements with constraints (primary keys, check constraints, etc.).