/* Find all columns names 'course_id' across multiple tables */ SELECT table_name, column_name # Find all tables that have FROM information_schema.COLUMNS # column names like 'course_id' WHERE column_name LIKE '%course_id%'; /* Find all columns having the same name across multiple tables */ SELECT column_name, table_name # Find all tables FROM information_schema.COLUMNS # that have same column names WHERE table_schema = 'public' # for demo database ORDER BY 1,2;