# SHOW COLUMNS

Show the list of columns within a given table.

## Syntax

```

SHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name] [LIKE 'pattern' | WHERE expr]

```

## Remarks

* `LIKE` 'pattern' can be used to filter the list by name. SQL LIKE clause.
* This command must be run on the Master Aggregator or a child aggregator node (see [Node Requirements for SingleStore Commands](https://docs.singlestore.com/db/v9.1/reference/sql-reference/cluster-management-commands.md)).
* See the [Permission Matrix](https://docs.singlestore.com/db/v9.1/reference/sql-reference/security-management-commands/permissions-matrix.md) for the required permission.

**Output**

| Column    | Description                                                                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Field`   | Field name                                                                                                                                              |
| `Type`    | [Data types](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-types.md)                                                                |
| `Null`    | Whether this column allows nulls                                                                                                                        |
| `Key`     | An attribute or attributes that  uniquely identify table rows. There are several types of keys with the most common being primary, unique, and foreign. |
| `Default` | Default value, if applicable                                                                                                                            |
| `Extra`   | Additional information                                                                                                                                  |

## Example

```sql

SHOW COLUMNS IN mytbl;
+----------+------------+------+-----+---------+-------+
| Field    | Type       | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| seq      | int(11)    | YES  | MUL | NULL    |       |
| state    | int(11)    | YES  |     | NULL    |       |
| st_case  | varchar(8) | YES  |     | NULL    |       |
| veh_no   | varchar(2) | YES  |     | NULL    |       |
| drimpair | varchar(2) | YES  |     | NULL    |       |
+----------+------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

```

***

Modified at: May 22, 2023

Source: [/db/v9.1/reference/sql-reference/show-commands/show-columns/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/show-commands/show-columns/)

(An index of the documentation is available at /llms.txt)
