You can add keys to tables using native SQL. It's not supported by drupal 7 core api. I answered this previously elsewhere:
Is there a way to add a foreign key to a table?
I doubt that simply adding a key will expose the relationship for you in Views though.
In order for Views to see this information you likely need to supply the info via hook_views_data() about your custom tables and relationships. A recent blog post I found about this today actually was:
https://chacadwa.com/blog/2014/08/12/adding-full-views-support-custom-entities
From this blog post you can see that for a table that needs a join to add extra fields (and to do so by default in Views) they add the following array to their hook_views_data() function.
// Define a default relationship to the staffdir extra data table.
$data['hank_hrper']['table']['default_relationship'] = array(
'hank_hrper_extra_data' => array(
'table' => 'hank_hrper_extra_data',
'field' => 'hrper_id',
),
);
// Now define the staffdir extra data table, so views can use it.
$data['hank_hrper_extra_data'] = array(
'table' => array(
'group' => t('Staff directory'),
'entity type' => 'staffdir',
'join' => array(
'hank_hrper' => array(
'left_field' => 'hrper_id',
'field' => 'hrper_id',
),
),
'default_relationship' => array(
'hank_hrper' => array(
'table' => 'hank_hrper',
'field' => 'hrper_id',
),
),
),
);
// Now we can define fields from the staffdir extra data table for use in the relationship.
$data['hank_hrper_extra_data']['opt_out'] = array(
'title' => t('Opt out'),
'help' => t('Allows for users to be excluded from the directory.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => FALSE, // could be TRUE, but why?
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'accept null' => TRUE,
'help' => t('Filter results to a particular result set'),
),
);