How to create db table while installing a module?
You should implements hook_schema() in your modulename.install file. In druapl 7, you do not need to use hook_install to create database table. 


  A Drupal schema definition is an array structure representing one or
  more tables and their related keys and indexes. A schema is defined by
  hook_schema() which must live in your module's .install file.


Code Snippets:

/**
 * Implements hook_schema() 
 */

function custom_travel_api_schema() {

  $schema['custom_booking'] = array(
    'description' =&gt; 'To store the booking flight.',
    'fields' =&gt; array(
      'bid' =&gt; array(
       'type' =&gt; 'serial',
        'unsigned' =&gt; TRUE,
        'not null' =&gt; TRUE,
        'description' =&gt; 'The booking id.',        
      ),
      'source' =&gt; array(
        'type' =&gt; 'varchar',
        'length' =&gt; '255',
        'description' =&gt; 'The source city for the booking.',
      ),
      'destination' =&gt; array(
        'type' =&gt; 'varchar',
        'length' =&gt; '255',
        'description' =&gt; 'The destination city for the booking.',
      ),
      'bdate' =&gt; array(
        'type' =&gt; 'int',
        'not null' =&gt; TRUE,
        'default' =&gt; 0,        
        'description' =&gt; 'The date of the booking',
      ),
      'amount' =&gt; array(
        'type' =&gt; 'int',
        'not null' =&gt; TRUE,
        'default' =&gt; 0,        
        'description' =&gt; 'The amount of the booking',
      ),
      'status' =&gt; array(
        'type' =&gt; 'int',
        'not null' =&gt; TRUE,
        'default' =&gt; 0,        
        'description' =&gt; 'The status of the booking(0 -&gt; In process, 1 -&gt; completed)',
      ),
      'uid' =&gt; array(
        'type' =&gt; 'int',
        'not null' =&gt; TRUE,
        'default' =&gt; 0,        
        'description' =&gt; 'The user id of the booking',
      ),
    ),
    'primary key' =&gt; array('bid'),
  );

  return $schema;

}


You can check this for more reference.