desc command in sql code example
Example 1: describe table in sql
desc <table name>;
Example 2: select from describe sql
SELECT COLUMN_NAME AS `Field`, COLUMN_TYPE AS `Type`, IS_NULLABLE AS `NULL`,
COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS `Extra`
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'schemaName' AND TABLE_NAME = 'table1';
Example 3: sql desc
Used with ORDER BY to return the data in descending order.
Example: Raddish, Peaches, Bananas, Apples