I’m a SQL-novice and working in Google Big Query…
I have a table like this, a manager have some employees and the employees are males or females.
Manager_ | Employee_ | Gender___ |
---|---|---|
John__ | Henry__ | Male |
John__ | Sam___ | Male |
John__ | Joe___ | Male |
John__ | Jack__ | Male |
Adam__ | Donald | Male |
Adam__ | George | Male |
Adam__ | Samantha | Female |
Adam__ | Tim | Male |
Mary__ | Celine | Female |
Mary__ | Annie | Female |
Mary__ | Emmy | Female |
Mary__ | Jenny | Female |
I want something like this, a column tells that the managers group is mixed or just contain males or females, like the table below:
Manager_ | Employee_ | Gender___ | Variation |
---|---|---|---|
John__ | Henry__ | Male | Only_male |
John__ | Sam___ | Male | Only_male |
John__ | Joe___ | Male | Only_male |
John__ | Jack__ | Male | Only_male |
Adam__ | Donald | Male | Mixed |
Adam__ | George | Male | Mixed |
Adam__ | Samantha | Female | Mixed |
Adam__ | Tim | Male | Mixed |
Mary__ | Celine | Female | Only_female |
Mary__ | Annie | Female | Only_female |
Mary__ | Emmy | Female | Only_female |
Mary__ | Jenny | Female | Only_female |
The value in the “variation” column must be repeated on every row, in this case where Adam is manager.
Or some other opportunity to filter a group of mixed genders?
I don’t know what to try… 🙁 Sorry!