Artur123ff2

Untitled

Mar 25th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.31 KB | None | 0 0
  1. select avg(N.number) as Average
  2. from (
  3.     select t.team_name, count(tt.team_id) as 'Number'
  4.     from teams as t
  5.     left join (
  6.         select t.team_id, t.TEAM_NAME
  7.         from teams as t
  8.         join employees as e on e.TEAM_ID= t.TEAM_ID
  9.         where e.gender = 'F'
  10.     ) as tt on t.TEAM_ID = tt.team_id
  11.     group by t.team_name
  12. ) as N
Add Comment
Please, Sign In to add comment