How to search for a specific column name in all the tables in MySQL Workbench - MySQL DBA Tutorial

How to search for a specific column name in all the tables in MySQL Workbench


explains what are different ways you can find out if the column exists in database or not for a table. You can query information_schema or you can use schema inspector to find out the column if it exits or does not exists in MySQL Server.


Query you can use to find out if column exists
SELECT
    table_name,
    column_name,
    data_type,
    ordinal_position
FROM  INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = 'schema_name'
  AND column_name = 'Column_name' ;

MySQL Workbench Tutorial - How to check if column exists in MySQL Database