Finding all tables having not null constraints in mysql
How to find all the table and column names that have not null con开发者_如何学Pythonstraint
If you have an access to information_schema
database, you can use this query:
SELECT `TABLE_NAME`, `COLUMN_NAME`
FROM `information_schema`.`COLUMNS`
WHERE
`IS_NULLABLE` = 'No'
AND `TABLE_SCHEMA` = 'Your database name goes here'
Tested in MySQL 5.1
精彩评论