SQL EXPLAIN and DESCRIBE DESCRIBE tablename;

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

DESCRIBE and EXPLAIN are synonyms. DESCRIBE on a tablename returns the definition of the columns.

DESCRIBE tablename;

Exmple 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)     

Here you see the column names, followed by the columns type. It shows if null is allowed in the column and if the column uses an Index. the default value is also displayed and if the table contains any special behavior like an auto_increment.



Got any SQL Question?