## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
createTableStatement_start((START))
createTableStatement_start --> createTableStatement_0_0[CREATE]:::quoted
createTableStatement_0_0 --> createTableStatement_0_1["OR REPLACE"]:::quoted
createTableStatement_0_1 --> createTableStatement_0_2["TABLE"]:::quoted
createTableStatement_0_2 --> createTableStatement_0_3[tableSpec]
createTableStatement_0_3 --> createTableStatement_0_4[AS]:::quoted
createTableStatement_0_4 --> createTableStatement_0_5[selectStatement]
createTableStatement_0_5 --> createTableStatement_0_6["("]:::quoted
createTableStatement_0_6 --> createTableStatement_0_7[createTableArgument]
createTableStatement_0_7 --> createTableStatement_0_8[","]:::quoted
createTableStatement_0_8 --> createTableStatement_0_9[createTableArgument]
createTableStatement_0_9 --> createTableStatement_0_10[")"]:::quoted
createTableStatement_0_10 --> createTableStatement_0_11[BATCHSIZE]:::quoted
createTableStatement_0_11 --> createTableStatement_0_12[numericConstant]
createTableStatement_0_12 --> createTableStatement_end((END))
```
## Purpose
Create a table on the specified platform, filled with data from the select statement. An error is raised when a table with the same name already exists. When 'or replace' is specified, a previously existing table with the same name is dropped before creating the new table.
When using the replace clause, a previous version of the identical named table is replaced, including removal of all data contained in the table. Otherwise an error is raised when a table with the same name already exists. When using the if not exists clause (available from 25.0.41 and 24.0.778), the table is only created when a previous version of the identical named table did not exist.
A new table is assigned a technical primary key column. Also indexes are created by default where the distribution and volume of the data is such that an index is expected to improve performance considerably.
## createTableArgument
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
createTableArgument_start((START))
createTableArgument_start --> createTableArgument_0_0[identifier]
createTableArgument_0_0 --> createTableArgument_0_1[sqlDataTypeExtended]
createTableArgument_0_1 --> createTableArgument_end((END))
```