columns

The view information_schema.columns contains information about all columns of tables and views in the database.

SELECT * FROM information_schema.columns;
SELECT table_schema, table_name, column_name, ordinal_position FROM information_schema.columns;

information_schema.columns

column nametyperemarks
table_catalogVARCHARAlways NULL
table_schemaVARCHAR
table_nameVARCHAR
column_nameVARCHAR
ordinal_positionINTEGER
column_defaultVARCHAR
is_nullableVARCHARNO or YES
data_typeVARCHAR
character_maximum_lengthINTEGER
character_octet_lengthBIGINT
numeric_precisionINTEGER
numeric_precision_radixINTEGER
numeric_scaleINTEGER
datetime_precisionINTEGER
interval_typeVARCHAR
interval_precisionINTEGER
character_set_catalogVARCHARAlways NULL
character_set_schemaVARCHARAlways NULL
character_set_nameVARCHAR
collation_catalogVARCHARAlways NULL
collation_schemaVARCHARAlways NULL
collation_nameVARCHARAlways NULL
domain_catalogVARCHARAlways NULL
domain_schemaVARCHARAlways NULL
domain_nameVARCHARAlways NULL
udt_catalogVARCHARAlways NULL
udt_schemaVARCHARAlways NULL
udt_nameVARCHARAlways NULL
scope_catalogVARCHARAlways NULL
scope_schemaVARCHARAlways NULL
scope_nameVARCHARAlways NULL
maximum_cardinalityINTEGER
dtd_identifierVARCHARAlways NULL
is_self_referencingVARCHARNO or YES
is_identityVARCHARNO or YES
identity_generationVARCHARNO or YES
identity_startBIGINT
identity_incrementBIGINT
identity_maximumBIGINT
identity_minimumBIGINT
identity_cycleVARCHAR
is_generatedVARCHARNO or YES
generation_expressionVARCHAR
is_system_time_period_startVARCHAR
is_system_time_period_endVARCHAR
system_time_period_timestamp_generationVARCHAR
is_updatableVARCHARNO or YES
declared_data_typeVARCHARAlways NULL
declared_numeric_precisionINTEGER
declared_numeric_scaleINTEGER
schema_idINTEGERreference to sys.schemas.id
table_idINTEGERreference to sys.tables.id
column_idINTEGERreference to sys.columns.id
sequence_idINTEGERreference to sys.sequences.id when is_identity = 'YES'
is_systemBOOLEANtrue when the column is part of a system table or view, else false
commentsVARCHAR

Note: The last 6 columns (schema_id, table_id, column_id, sequence_id, is_system and comments) are extensions to the view as defined by ISO standard. They provide useful information and simplify filtering and joins with system tables/views in sys schema when needed.