Syntax\n------\n\nSHOW [FULL] {COLUMNS | FIELDS} FROM tbl_name [FROM db_name]\n    [LIKE 'pattern' | WHERE expr]\n\nDescription\n-----------\n\nSHOW COLUMNS displays information about the columns in a given table. It also works for views. The LIKE clause, if present on its own, indicates which column names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nIf the data types differ from what you expect them to be based on aCREATE TABLE statement, note that MariaDB sometimes changes data types when you create or alter a table. The conditions under which this occurs are described in the Silent Column Changes article.\n\nThe FULL keyword causes the output to include the column collation and comments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to thetbl_name FROM db_name syntax. In other words, these two statements are equivalent:\n\n``sql\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n`\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for non-binary string columns, or NULL for other columns. This value is displayed only if you use the FULL keyword.\n\nThe Null field contains YES if NULL values can be stored in the column, NO if not.\n\nThe Key field indicates whether the column is indexed:\n\n If Key is empty, the column either is not indexed or is indexed only as a secondary column in a multiple-column, non-unique index.\n If Key is PRI, the column is a PRIMARY KEY or is one of the columns in a multiple-column PRIMARY KEY.\n If Key is UNI, the column is the first column of a unique-valued index that cannot contain NULL values.\n If Key is MUL, multiple occurrences of a given value are allowed within the column. The column is the first column of a non-unique index or a unique-valued index that can contain NULL values.\n\nIf more than one of the Key values applies to a given column of a table, Key displays the one with the highest priority, in the order PRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values and there is noPRIMARY KEY in the table. A UNIQUE index may display as MUL if several columns form a compositeUNIQUE index; although the combination of the columns is unique, each column can still hold multiple occurrences of a given value.\n\nThe Default field indicates the default value that is assigned to the column.\n\nThe Extra field contains any additional information that is available about a given column.\n\n| Value                        | Description                                                                          |\n| ---------------------------- | ------------------------------------------------------------------------------------ |\n| AUTO_INCREMENT              | The column was created with the AUTO_INCREMENT keyword.                             |\n| PERSISTENT                   | The column was created with the PERSISTENT keyword.                                  |\n| VIRTUAL                      | The column was created with the VIRTUAL keyword.                                     |\n| on update CURRENT_TIMESTAMP | The column is a TIMESTAMP column that is automatically updated on INSERT and UPDATE. |\n\nPrivileges indicates the privileges you have for the column. This value is displayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed only if you use the FULL keyword.\n\nSHOW FIELDS is a synonym forSHOW COLUMNS. Also DESCRIBE and EXPLAIN can be used as shortcuts.\n\nYou can also list a table's columns with:\n\n`\nmariadb-show db_name tbl_name\n`\n\nSee the mariadb-show command for more details.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS`. The information_schema.COLUMNS table provides similar, but more complete, information.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements also provide information about tables.\n\nExamples\n--------\n\nSHOW COLUMNS FROM city;\n+------------+----------+------+-----+---------+----------------+\n| Field      | Type     | Null | Key | Default | Extra          |\n+------------+----------+------+-----+---------+----------------+\n| Id         | int(11)  | NO   | PRI | NULL    | auto_increment |\n| Name       | char(35) | NO   |     |         |                |\n| Country    | char(3)  | NO   | UNI |         |                |\n| District   | char(20) | YES  | MUL |         |                |\n| Population | int(11)  | NO   |     | 0       |                |\n+------------+----------+------+-----+---------+----------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-columns