Am trying to write a sql query to get the data in a particular format. Please see my actual data below and the result am trying to get.
Sport Team No of Females No of males
Baseball Varsity 20 0
Baseball Varsity 20
Football Varsity 15
Above is the format of the table and data in the actual database.
Now i want to get the data in this below format.
Female Only Male only Total
Sports 1 2 2
Teams 1 2 3
Participants 20 35 55
Please help me with the sql query , I tried using pivot and count of the columns but i couldn't achieve the way i wanted. Thanks for your help!.