Com este comando consegue obter uma listagem dos produtos existentes na base de dados e respectivos Stocks:
SELECT p.ID AS product_id,
p.post_title AS product_name,
pm.meta_value AS stock_quantity
FROM wp_posts AS p
JOIN wp_postmeta AS pm ON p.ID = pm.post_id
WHERE p.post_type IN ('product', 'product_variation')
AND pm.meta_key = '_stock'
AND p.post_status = 'publish'
ORDER BY p.post_title;