-
-
Save koras/2686faebfed646a77d50efba264681d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DISTINCT - убираем дубли | |
SELECT DISTINCT department_id | |
# DISTINCT - где ищем | |
FROM evaluations | |
# gender = TRUE - только мужчины, подразумеваем что false это женский пол | |
WHERE gender = TRUE | |
# групируем по департаменту | |
GROUP BY department_id | |
# В результате груперовки вычисляем только тех кто поставил > 5 | |
HAVING AVG(`value`) > 5; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment