> ## 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.

> توثيق DESCRIBE TABLE

# DESCRIBE TABLE

يعرض معلومات عن أعمدة الجدول.

**البنية**

```sql theme={null}
DESC|DESCRIBE TABLE [db.]table [INTO OUTFILE filename] [FORMAT format]
```

تعيد عبارة `DESCRIBE` صفًا لكل عمود في الجدول، بالقيم التالية من نوع [String](/ar/reference/data-types/string):

* `name` — اسم العمود.
* `type` — نوع العمود.
* `default_type` — عبارة تُستخدم في [التعبير الافتراضي](/ar/reference/statements/create/table) للعمود: `DEFAULT` أو `MATERIALIZED` أو `ALIAS`. وإذا لم يكن هناك تعبير افتراضي، فستُعاد سلسلة فارغة.
* `default_expression` — تعبير مُحدَّد بعد العبارة `DEFAULT`.
* `comment` — [تعليق العمود](/ar/reference/statements/alter/column#comment-column).
* `codec_expression` — [codec](/ar/reference/statements/create/table#column_compression_codec) مُطبَّق على العمود.
* `ttl_expression` — تعبير [TTL](/ar/reference/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-ttl).
* `is_subcolumn` — علامة تساوي `1` للأعمدة الفرعية الداخلية. ولا يُضمَّن هذا الحقل في النتيجة إلا إذا كان وصف الأعمدة الفرعية مُمكّنًا بواسطة الإعداد [describe\_include\_subcolumns](/ar/reference/settings/session-settings#describe_include_subcolumns).

تُوصَف جميع الأعمدة في هياكل البيانات [Nested](/ar/reference/data-types/nested-data-structures/index) كلٌّ على حدة. ويُسبَق اسم كل عمود باسم العمود الأب متبوعًا بنقطة.

لعرض الأعمدة الفرعية الداخلية لأنواع البيانات الأخرى، استخدم الإعداد [describe\_include\_subcolumns](/ar/reference/settings/session-settings#describe_include_subcolumns).

**مثال**

```sql title="Query" theme={null}
CREATE TABLE describe_example (
    id UInt64, text String DEFAULT 'unknown' CODEC(ZSTD),
    user Tuple (name String, age UInt8)
) ENGINE = MergeTree() ORDER BY id;

DESCRIBE TABLE describe_example;
DESCRIBE TABLE describe_example SETTINGS describe_include_subcolumns=1;
```

```text title="Response" theme={null}
┌─name─┬─type──────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ id   │ UInt64                        │              │                    │         │                  │                │
│ text │ String                        │ DEFAULT      │ 'unknown'          │         │ ZSTD(1)          │                │
│ user │ Tuple(name String, age UInt8) │              │                    │         │                  │                │
└──────┴───────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
```

يعرض الاستعلام الثاني أيضًا الأعمدة الفرعية:

```text title="Response" theme={null}
┌─name──────┬─type──────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┬─is_subcolumn─┐
│ id        │ UInt64                        │              │                    │         │                  │                │            0 │
│ text      │ String                        │ DEFAULT      │ 'unknown'          │         │ ZSTD(1)          │                │            0 │
│ user      │ Tuple(name String, age UInt8) │              │                    │         │                  │                │            0 │
│ user.name │ String                        │              │                    │         │                  │                │            1 │
│ user.age  │ UInt8                         │              │                    │         │                  │                │            1 │
└───────────┴───────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┴──────────────┘
```

يمكن أيضًا استخدام عبارة DESCRIBE مع الاستعلامات الفرعية أو التعبيرات القيمية:

```SQL theme={null}
DESCRIBE SELECT 1 FORMAT TSV;
```

أو

```SQL theme={null}
DESCRIBE (SELECT 1) FORMAT TSV;
```

```text title="Response" theme={null}
1       UInt8
```

يُرجع هذا الاستخدام بيانات وصفية عن أعمدة نتائج الاستعلام أو الاستعلام الفرعي المحدد. ويكون مفيدًا لفهم بنية الاستعلامات المعقدة قبل تنفيذها.

**انظر أيضًا**

* إعداد [describe\_include\_subcolumns](/ar/reference/settings/session-settings#describe_include_subcolumns).
