SQL Interview Questions | Get the appropriate result

Name Gender X MALE XY FEMALE XYZ FEMALE Y MALE YZ FEMALE YZX MALE Z FEMALE The given table is a part of a larger table consisting data of people present in a meeting. This data needs to be sorted and the output should be like this, MALE FEMALE 3 4 Write the query accordingly.