I'm trying to merge Magento orders between two different stores and I'm tracking down all of the relationships. The one I'm currently trying to figure out is the customer_entity table and the sales_* tables. I don't see a foreign key or entity_id that would line the two up.
How does Magento associate customer tables with sales?
sales_flat_order.customer_id
Since customer can check out as guest, then customer_id is either null for quest or contain the customer id for register member