Using views with a custom table/schema
Your module needs to implement hook_views_data().

The example given in the hook documentation is for a table defined from the following SQL.

CREATE TABLE example_table (
  nid INT(11) NOT NULL,
  plain_text_field VARCHAR(32,
  numeric_field INT(11),
  boolean_field INT(1),
  timestamp_field INT(8),
  PRIMARY KEY(nid)
);




function mymodule_views_data() {
  $data['example_table']['table']['group'] = t('Example table');

  $data['example_table']['table']['base'] = array(
    'field' =&gt; 'nid',
    'title' =&gt; t('Example table'), 
    'help' =&gt; t('Example table contains example content and can be related to nodes.'), 
    'weight' =&gt; -10,
  );

  $data['example_table']['table']['join'] = array(
    'node' =&gt; array(
      'left_field' =&gt; 'nid', 
      'field' =&gt; 'nid',
    ),
  );

  $data['example_table']['nid'] = array(
    'title' =&gt; t('Example content'), 
    'help' =&gt; t('Some example content that references a node.'),
    'relationship' =&gt; array(
      'base' =&gt; 'node',
      'base field' =&gt; 'nid', // The name of the field on the joined table.
      // 'field' =&gt; 'nid' -- see hook_views_data_alter(); not needed here.
      'handler' =&gt; 'views_handler_relationship', 
      'label' =&gt; t('Example node'),
    ),
  );

  $data['example_table']['plain_text_field'] = array(
    'title' =&gt; t('Plain text field'), 
    'help' =&gt; t('Just a plain text field.'), 
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field', 
      'click sortable' =&gt; TRUE,
    ), 
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ), 
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_string',
    ), 
    'argument' =&gt; array(
      'handler' =&gt; 'views_handler_argument_string',
    ),
  );

  $data['example_table']['numeric_field'] = array(
    'title' =&gt; t('Numeric field'), 
    'help' =&gt; t('Just a numeric field.'), 
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_numeric', 
      'click sortable' =&gt; TRUE,
    ), 
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_numeric',
    ), 
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
  );

  $data['example_table']['boolean_field'] = array(
    'title' =&gt; t('Boolean field'), 
    'help' =&gt; t('Just an on/off field.'), 
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_boolean', 
      'click sortable' =&gt; TRUE,
    ), 
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_boolean_operator',
      'label' =&gt; t('Published'),
      'type' =&gt; 'yes-no',
      'use equal' =&gt; TRUE,
    ), 
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort',
    ),
  );

  $data['example_table']['timestamp_field'] = array(
    'title' =&gt; t('Timestamp field'), 
    'help' =&gt; t('Just a timestamp field.'), 
    'field' =&gt; array(
      'handler' =&gt; 'views_handler_field_date', 
      'click sortable' =&gt; TRUE,
    ), 
    'sort' =&gt; array(
      'handler' =&gt; 'views_handler_sort_date',
    ), 
    'filter' =&gt; array(
      'handler' =&gt; 'views_handler_filter_date',
    ),
  );

  return $data;
}