Skip to main content
Lists columns and their properties for a specified table. Returns <table_name>, <column_name>, <data_type>, and nullable (TRUE if nullable, FALSE if not) for each column. For more information regarding columns, see information_schema.columns.

Syntax

SHOW COLUMNS [<table>];

Parameters

ParameterDescription
<table> (optional)The name of the table for which the columns should be shown.

Returns

The returned table has the following columns.
Column nameData TypeDescription
table_nameTEXTName of the table containing the column.
column_nameTEXTName of the column.
data_typeTEXTThe data type of the column.
nullableBOOLEANIndicates if the column may contain NULL.

Example

The following example highlights all of the columns from the tournaments table:
SHOW COLUMNS tournaments;
table_namecolumn_namedata_typenullable
tournamentsenddatetimeTIMESTAMPFALSE
tournamentsgameidINTEGERFALSE
tournamentsnameTEXTFALSE
tournamentsrulesdefinitionTEXTFALSE
tournamentsSOURCE_FILE_NAMETEXTFALSE
tournamentsSOURCE_FILE_TIMESTAMPTIMESTAMPFALSE
tournamentsstartdatetimeTIMESTAMPFALSE
tournamentstotalprizedollarsINTEGERFALSE
tournamentstournamentidINTEGERFALSE