DESCRIBE tablename
suggest changeIn MySQL, DESCRIBE tablename is a synonym of EXPLAIN tablename and returns the column definitions. EXPLAIN before a SELECT is different: it shows the query plan.
DESCRIBE tablename;
Example result:
COLUMN_NAME COLUMN_TYPE IS_NULLABLE COLUMN_KEY COLUMN_DEFAULT EXTRA
id int(11) NO PRI 0 auto_increment
test varchar(255) YES (null)
The result shows each column name, followed by the column’s type. It shows whether NULL is allowed, whether the column is indexed, the default value, and extra behavior such as auto_increment. auto_increment is MySQL syntax.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents