DESCRIBE (alias DESC) is a non-standard but popular SQL command that reveals a table or view's schema. When run, the database engine queries its system catalog and outputs one row per column, showing the column name, data type, whether NULL values are allowed, key information, default values, and additional metadata like auto-increment flags. Because DESCRIBE is read-only, it never changes data or schema; it only surfaces metadata. Note that DESCRIBE is not part of the ANSI SQL standard and is primarily implemented in MySQL, MariaDB, and Oracle SQL*Plus. Other systems offer similar functionality through proprietary commands (for example, \d in psql) or by querying INFORMATION_SCHEMA. Attempting to run DESCRIBE in an unsupported database returns a syntax error.
database_name
(STRING) - Optional. Explicit database or schema that contains the table.table_name
(STRING) - Required. Name of the table or view to inspect.SHOW COLUMNS, INFORMATION_SCHEMA.COLUMNS, EXPLAIN, SHOW TABLES, PRAGMA table_info (SQLite)
MySQL 3.23 and Oracle SQL*Plus (circa 1980s)
MySQL, MariaDB, and Oracle's SQL*Plus CLI support DESCRIBE natively. Other databases require alternative commands.
No. It only reads metadata from the system catalog and never acquires locks that block writes.
Not directly. Use SHOW COLUMNS LIKE 'pattern' or query INFORMATION_SCHEMA for granular filtering.
DESCRIBE shows only whether a column participates in a key. To view full foreign key constraints, query INFORMATION_SCHEMA.KEY_COLUMN_USAGE or use SHOW CREATE TABLE.