Running a custom query alongside Drupal Registration Query
The use of the hook_user_insert() it is call when the user is created. Here is an implementation example:

    function hook_user_insert(&amp;$edit, $account, $category) {
      db_insert('mytable')
        -&gt;fields(array(
        'myfield' =&gt; $edit['myfield'], 
        'uid' =&gt; $account-&gt;uid,
      ))
        -&gt;execute();
    }


Depending on your case you might want to check other hooks like:

hook_user_insert() 

hook_user_presave()

hook_user_update()