MySQL : how to query the description of a table?

Rework the result of DESCRIBE.

DESCRIBE is a keyword used to display the structure of a table. There is several ways of reworking the result. Such as:

SHOW COLUMNS with a WHERE clause

SHOW COLUMNS FROM my_table WHERE TYPE="text"

The database information_schema contains all the information about the structure of other databases. Among them, the table COLUMNS that we can use to display the same result than DESCRIBE or SHOW COLUMNS.

The table information_schema.COLUMNS

SELECT COLUMN_NAME AS `Field`, COLUMN_TYPE AS `Type`, IS_NULLABLE AS `NULL`, COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS `Extra` FROM information_schema.COLUMNS WHERE TABLE_NAME = "my_table" AND COLUMN_TYPE="text"