title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/columns.md)

Contains information about columns in all tables.

You can use this table to get information similar to the [DESCRIBE TABLE](/docs/sql-reference/statements/describe-table) query, but for multiple tables at once.

Columns from [temporary tables](/docs/sql-reference/statements/create/table#temporary-tables) are visible in the `system.columns` only in those session where they have been created. They are shown with the empty `database` field.

The `system.columns` table contains the following columns (the column type is shown in brackets):

- `database` ([String](/docs/sql-reference/data-types)) — Database name.
- `table` ([String](/docs/sql-reference/data-types)) — Table name.
- `name` ([String](/docs/sql-reference/data-types)) — Column name.
- `type` ([String](/docs/sql-reference/data-types)) — Column type.
- `position` ([UInt64](/docs/sql-reference/data-types)) — Ordinal position of a column in a table starting with 1.
- `default_kind` ([String](/docs/sql-reference/data-types)) — Expression type (DEFAULT, MATERIALIZED, ALIAS) for the default value, or an empty string if it is not defined.
- `default_expression` ([String](/docs/sql-reference/data-types)) — Expression for the default value, or an empty string if it is not defined.
- `data_compressed_bytes` ([UInt64](/docs/sql-reference/data-types)) — The size of compressed data, in bytes.
- `data_uncompressed_bytes` ([UInt64](/docs/sql-reference/data-types)) — The size of decompressed data, in bytes.
- `marks_bytes` ([UInt64](/docs/sql-reference/data-types)) — The size of marks, in bytes.
- `comment` ([String](/docs/sql-reference/data-types)) — Comment on the column, or an empty string if it is not defined.
- `is_in_partition_key` ([UInt8](/docs/sql-reference/data-types)) — Flag that indicates whether the column is in the partition expression.
- `is_in_sorting_key` ([UInt8](/docs/sql-reference/data-types)) — Flag that indicates whether the column is in the sorting key expression.
- `is_in_primary_key` ([UInt8](/docs/sql-reference/data-types)) — Flag that indicates whether the column is in the primary key expression.
- `is_in_sampling_key` ([UInt8](/docs/sql-reference/data-types)) — Flag that indicates whether the column is in the sampling key expression.
- `compression_codec` ([String](/docs/sql-reference/data-types)) — Compression codec name.
- `character_octet_length` ([Nullable(UInt64)](/docs/sql-reference/data-types)) — Maximum length in bytes for binary data, character data, or text data and images. In ClickHouse makes sense only for FixedString data type. Otherwise, the NULL value is returned.
- `numeric_precision` ([Nullable(UInt64)](/docs/sql-reference/data-types)) — Accuracy of approximate numeric data, exact numeric data, integer data, or monetary data. In ClickHouse it is bit width for integer types and decimal precision for Decimal types. Otherwise, the NULL value is returned.
- `numeric_precision_radix` ([Nullable(UInt64)](/docs/sql-reference/data-types)) — The base of the number system is the accuracy of approximate numeric data, exact numeric data, integer data or monetary data. In ClickHouse it's 2 for integer types and 10 for Decimal types. Otherwise, the NULL value is returned.
- `numeric_scale` ([Nullable(UInt64)](/docs/sql-reference/data-types)) — The scale of approximate numeric data, exact numeric data, integer data, or monetary data. In ClickHouse makes sense only for Decimal types. Otherwise, the NULL value is returned.
- `datetime_precision` ([Nullable(UInt64)](/docs/sql-reference/data-types)) — Decimal precision of DateTime64 data type. For other data types, the NULL value is returned.
- `serialization_hint` ([Nullable(String)](/docs/sql-reference/data-types)) — A hint for column to choose serialization on inserts according to statistics.
- `statistics` ([String](/docs/sql-reference/data-types)) — The types of statistics created in this columns.

**Example**

```
SELECT * FROM system.columns LIMIT 2 FORMAT Vertical;
```

```
Row 1:
──────
database:                INFORMATION_SCHEMA
table:                   COLUMNS
name:                    table_catalog
type:                    String
position:                1
default_kind:
default_expression:
data_compressed_bytes:   0
data_uncompressed_bytes: 0
marks_bytes:             0
comment:
is_in_partition_key:     0
is_in_sorting_key:       0
is_in_primary_key:       0
is_in_sampling_key:      0
compression_codec:
character_octet_length:  ᴺᵁᴸᴸ
numeric_precision:       ᴺᵁᴸᴸ
numeric_precision_radix: ᴺᵁᴸᴸ
numeric_scale:           ᴺᵁᴸᴸ
datetime_precision:      ᴺᵁᴸᴸ

Row 2:
──────
database:                INFORMATION_SCHEMA
table:                   COLUMNS
name:                    table_schema
type:                    String
position:                2
default_kind:
default_expression:
data_compressed_bytes:   0
data_uncompressed_bytes: 0
marks_bytes:             0
comment:
is_in_partition_key:     0
is_in_sorting_key:       0
is_in_primary_key:       0
is_in_sampling_key:      0
compression_codec:
character_octet_length:  ᴺᵁᴸᴸ
numeric_precision:       ᴺᵁᴸᴸ
numeric_precision_radix: ᴺᵁᴸᴸ
numeric_scale:           ᴺᵁᴸᴸ
datetime_precision:      ᴺᵁᴸᴸ
```

Was this page helpful?