> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Displays the dictionary data as a ClickHouse table. Works the same way as the Dictionary engine.

# dictionary

Displays the [dictionary](/reference/statements/create/dictionary) data as a ClickHouse table. Works the same way as [Dictionary](/reference/engines/table-engines/special/dictionary) engine.

<h2 id="syntax">
  Syntax
</h2>

```sql theme={null}
dictionary('dict')
```

<h2 id="arguments">
  Arguments
</h2>

* `dict` — A dictionary name. [String](/reference/data-types/string).

<h2 id="returned_value">
  Returned value
</h2>

A ClickHouse table.

<h2 id="examples">
  Examples
</h2>

Input table `dictionary_source_table`:

```text theme={null}
┌─id─┬─value─┐
│  0 │     0 │
│  1 │     1 │
└────┴───────┘
```

Create a dictionary:

```sql title="Query" theme={null}
CREATE DICTIONARY new_dictionary(id UInt64, value UInt64 DEFAULT 0) PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dictionary_source_table')) LAYOUT(DIRECT());
```

```sql title="Query" theme={null}
SELECT * FROM dictionary('new_dictionary');
```

```text title="Response" theme={null}
┌─id─┬─value─┐
│  0 │     0 │
│  1 │     1 │
└────┴───────┘
```

<h2 id="related">
  Related
</h2>

* [Dictionary engine](/reference/engines/table-engines/special/dictionary)
