# Insert data

INSERT adds rows through a common set of destination type and constraint checks. Choose the input path according to where the data already lives.

## Literal and query input

Use VALUES for explicit rows and INSERT SELECT to copy or transform rows produced by a query. A column list can leave other columns to their SQL defaults.

```sql
CREATE TABLE items(id INTEGER PRIMARY KEY, name String DEFAULT 'unknown');
INSERT INTO items(id) VALUES (1), (2);
```

```sql
SELECT id, name
FROM items
ORDER BY id
FORMAT csv;
```

```text
1,"unknown"
2,"unknown"
```

## Formats and files

INSERT FORMAT decodes a registered input format. The native client can send stdin or read local files with FROM INFILE, including supported compression. Every row from one file-input INSERT belongs to one statement.

For inline data, place SETTINGS before FORMAT and send later SQL in another request. HTTP can supply INSERT SQL in the query parameter and format bytes in the body.

All input paths validate target declarations and constraints. See [`INSERT INTO`](https://coordinatordb.com/docs/reference/statements/insert-into), [batch inserts](https://coordinatordb.com/docs/concepts/features/operations/insert/bulkinserts) and the [format guide](https://coordinatordb.com/docs/guides/clickhouse/data-formats/intro).
