How we can get more information about columns of a table than the
information we got by DESCRIBE, EXPLAIN and SHOW COLUMNS MySQL statements?


With the statement SHOW FULL COLUMNS, we can get more information about the columns of a table than the information we got by DESCRIBE, EXPLAIN, and SHOW COLUMNS MySQL statements.

Syntax

SHOW FULL COLUMNS from Table_name;

Example

mysql> SHOW FULL COLUMNS FROM EMPLOYEE\G;

*************************** 1. row ***************************
     Field: ID
      Type: int(11)
 Collation: NULL
      Null: NO
       Key: PRI
   Default: NULL
     Extra: auto_increment
Privileges: select,insert,update,references
   Comment:

*************************** 2. row ***************************
     Field: Name
      Type: varchar(20)
 Collation: latin1_swedish_ci
      Null: YES
       Key:
   Default: NULL
     Extra:
Privileges: select,insert,update,references
   Comment:
2 rows in set (0.04 sec)

In the example above, we are using this statement on a table named ‘employee’ and we can observe that we got more information like information about Collation, Privileges, and Comment on the columns of that table. This information was not part of the output of DESCRIBE, EXPLAIN, and SHOW COLUMN statement.

Updated on: 22-Jun-2020

67 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements