MySql Query To Get Important Column Properties of A Table

MySql Query :

SELECT  COLUMN_NAME
, DATA_TYPE
, CHARACTER_MAXIMUM_LENGTH
, NUMERIC_PRECISION
, NUMERIC_SCALE
, EXTRA
, COLUMN_KEY
, COLUMN_DEFAULT
, IS_NULLABLE
, COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'YourTableName'
AND TABLE_SCHEMA = 'YourDatabaseName'

Example OutPut:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami