SHOW and DESCRIBE

SHOW, DESCRIBE, and the Information Schema

Since MySQL 8.0 524 every definition lives in a transactional data dictionary of hidden InnoDB tables. INFORMATION_SCHEMA puts standard SQL views over it, and SHOW TABLES, SHOW CREATE TABLE, SHOW INDEX, SHOW GRANTS, SHOW PROCESSLIST and SHOW ENGINE INNODB STATUS are shortcuts over the same data. DESCRIBE (or DESC) is short for SHOW COLUMNS:

A table's columnsSQL
DESCRIBE customers;
Output
+------------+--------------+------+-----+-------------------+-------------------+
| Field      | Type         | Null | Key | Default           | Extra             |
+------------+--------------+------+-----+-------------------+-------------------+
| id         | int unsigned | NO   | PRI | NULL              | auto_increment    |
| email      | varchar(255) | NO   | UNI | NULL              |                   |
| name       | varchar(100) | NO   |     | NULL              |                   |
| country    | char(2)      | NO   |     | NULL              |                   |
| created_at | datetime     | NO   |     | CURRENT_TIMESTAMP | DEFAULT_GENERATED |
+------------+--------------+------+-----+-------------------+-------------------+

INFORMATION_SCHEMA can join and filter, so scripts use it: key_column_usage WHERE referenced_table_name IS NOT NULL lists shop's seven foreign keys. Its size columns (TABLE_ROWS, DATA_LENGTH) are InnoDB estimates cached for information_schema_stats_expiry seconds (a day by default); run ANALYZE TABLE, or set the variable to 0 in your session, for fresh numbers.