Query to get the top buyers in Magento 2

Note: If customer_id is NULL so it’s the guest user.

Standalone function get increment_id using order id