Which is the correlation between an ORDER and the USER who bought in WooCommerce/WordPress database
<p>I need to know if a user has bought a WooCommerce product. And if is it possible how many order he did. </p>

<p>So I checked in the WordPress database, and find the "wp_woocommerce_order_items" table.</p>

<p>here I can find these data
<a href="https://i.stack.imgur.com/f8LZY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f8LZY.png" alt="enter image description here"></a></p>

<p>The order_item_id field is used to join this table with the products meta. I don't find the reason for the order_id.</p>

<p>And I can't understand how I can find the user who made the order. </p>

<p><a href="https://i.stack.imgur.com/eI1hn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eI1hn.png" alt="enter image description here"></a></p>

<p>As you can see in the second picture (wp_usermeta table) I don't have no one field common with the order table.</p>

<p>So which is the common filed to join this 2 table?</p>

<p>I need only the field name that contain this info/value.</p>

<p>Virtual hugs for those who help me!</p>