Zend certified PHP/Magento developer

Magento 2 require to create SQL query for the custom report

I would like to generate Magento native report as follows:

enter image description here

Can anybody provide the SQL query for above table ?

  1. Column Name CustomerGender = customer attribute
  2. Column Name Group = Customer Group native feature
  3. Grand Total = Grand total from Sales order table

Went through plenty of the links but got regular simple joins.

Create Magento Custom Report Module

https://github.com/mageplaza/magento-2-reports