This query returns nullability information of the specified column.
Query
select c.table_schema,
c.table_name,
c.column_name,
case c.is_nullable
when 'NO' then 'NOT NULLABLE'
when 'YES' then 'IS NULLABLE'
end as nullable
from information_schema.columns c
join information_schema.tables t
on c.table_schema = t.table_schema
and c.table_name = t.table_name
where t.table_type = 'BASE TABLE'
order by table_schema,
table_name,
column_name;
Columns
- table_schema - name of schema
- table_name - name of table
- column_name - name of column
- nullable - nullability attribute for the column:
- is nullable - is nullable
- not nullable - is not nullable
Rows
- One row nullability of the specified column
- Scope of rows - all columns in the database
- Order by - table schema, table_name, column name