This statement is used to view the table statistics. The names and data types of all columns in a specified table will be returned.
1 | DESCRIBE [EXTENDED|FORMATTED] [db_name.]table_name; |
Parameter |
Description |
---|---|
db_name |
Database name that contains letters, digits, and underscores (_). It cannot contain only digits or start with an underscore (_). |
table_name |
Table name of a database that contains letters, digits, and underscores (_). It cannot contain only digits or start with an underscore (_). The matching rule is ^(?!_)(?![0-9]+$)[A-Za-z0-9_$]*$. If special characters are required, use single quotation marks ('') to enclose them. |
The to-be-queried table must exist. If this statement is used to query the information about a table that does not exist, an error is reported.
To query the names and data types of all columns in the student table, run the following statement:
1 | DESCRIBE student; |