In MySQL using a simple command is possible to have important information from a table, the DESCRIBE command is used to return data as columns and type of data they store.
To use the DESCRIBE command just use the following syntax:
DESCRIBE [Table Name]
Let’s use a practical example using a table called tbl_product to exemplify the use of the command.
At the time this command is executed will be made available the following information:
- All columns of the table;
- The data type of each table indicated by the column “Type”;
- The NULL indicator showing whether or not this field accepts this type of information;
- If the column is a primary key or not, this information will be shown in the column “PRI”;
In addition to the standard columns with information other columns are displayed as “UNI”, “MUL”, and “DEFAULT”, for example.
Although simple DESCRIBE command is one of the most important features that MySQL offers and so know it is pretty important.
MySQL has gained much market share as well as web development language PHP, learn about MySQL PHP combined with our official site.