Information about currently select menu is located in wp_options table as serialized PHP array. For example if we use TwentyEleven theme, then we will have a record in wp_options table with option_name column equals to theme_mod_twentyeleven and option_value column equals to ...;s:18:"nav_menu_locations";a:1:{s:7:"primary";i:103;}}. Here you can see that menu with term_id equals to 103 is currently selected as "primary" menu.
The key principle here is that we always have separate options record for each WP theme. Such options have the same name structure: theme_mods_{your-theme-name}.
P.S.: To change current menu in the admin panel, just go to Appearance » Menus page and select menu you need in Theme Locations meta box:
enter image description here
Source: Eugene Manuilov
on stackoverflow
Notes from me ( digitalzoomstudio )
Okay, this is correct, but incomplete; missing a few key items. For example, the pages / posts on which each item is stored. When trying to create a menu from php, this info is not enough because we need to link each post ( nav_menu_item type ) to page’s link.
This info is found in wp_postmeta table, containing info of each menu item – like nav_menu_item type ( custom / page ) or custom link etc. :
meta_id, post_id, option_name