The query contains 4 columns: the full name of the doctor, the number of male patients, the number of female patients, and the total number of patients seen by that doctor.
My problem is that I dont know how to count the number of males and females
I am only suppoused to use COUNT, GROUP BY and basic DML (cant use case when)
This depends on which database you are using specifically. One possible way to write this is:
Another common syntax for this is:
Some databases support this directly:
If you would really like to avoid any kind of conditional, then you could add gender to your groups but then you will have two rows for each doctor: