Skip to content

DESC

USE myDatabase;
DESC myTable;
+---------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(45) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
+---------+-------------+------+-----+---------+----------------+

The DESC statement is used in MySQL to describe the structure of a specified table in the database. In this example, DESC myTable; shows the columns (Field), data types (Type), whether NULL values are allowed (Null), the Key status of each column, the Default values, and any Extra information for each column in the myTable within myDatabase.