How to create a relationship between a table in a database and content type in views d7? A table table_A is present in database with a abc_nid and abc_code columns.
I have  a node having abc_nid as node_nid 
How can I link a abc_code (from the table_A) in a view using relationship(non programmatically) or any other way ?
You can certainly implement this functionality by creating a views plugin:


In your &lt;module_name&gt;.module file implement hook_views_api().
In your &lt;module_name&gt;.views.inc, implement hook_views_data(). Something roughly like this:

/** This hook should be placed in MODULENAME.views.inc and it will be
 * auto-loaded. MODULENAME.views.inc must be in the directory specified by the
 * 'path' key returned by MODULENAME_views_api(), or the same directory as the
 * .module file, if 'path' is unspecified.
 */
function MODULENAME_views_views_data() {
  $data = array();

  // Select/Create a category.
  $data['table_A']['table']['group'] = t('Your category');

  // Define the join with your table.
  $data['table_A']['table']['join'] = array(
      'node' =&gt; array(
      'left_field' =&gt; 'abc_nid',
      'field' =&gt; 'nid',
    ),
  );

  $data['table_A']['abc_code'] = array(
    'title' =&gt; t('ABC Code title'),
    'help' =&gt; t('Some help text.'),
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field',
    ),
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter',
    ),
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
  );
  return $data;
}


You can choose the appropriate handlers:


Views field handlers
Views sort handlers
Views filter handlers


If required you can add you own handlers by extending the handlers. But, adding a handler is required.
This will provide you a field, a filter and a sort criteria in your view of nodes which will display/filter/sort the fields on the basis of the value of abc_code for that particular field.