SQL – Query to find tables with column name

Here is an SQL query that you can use to find tables that contain a specific named column.

For example, list any tables with the ‘Gender’ column.

SELECT table_name
FROM information_schema.columns
WHERE column_name = 'Gender'

This query will return the names of all tables in the database that contain a column with the specified name.

Note: This query will only work for databases that support the information_schema schema, which is a standardized schema that provides metadata about the database. This schema is supported by many popular database management systems, such as MySQL, PostgreSQL, and Microsoft SQL Server.

Reference: https://stackoverflow.com/questions/4849652/find-all-tables-containing-column-with-specified-name