Skip to content

Commit 759f3d9

Browse files
committed
count_salary_categories.sql
1 parent b09e46f commit 759f3d9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Write your PostgreSQL query statement below
2+
SELECT UNNEST(ARRAY ['High Salary', 'Low Salary', 'Average Salary']) category,
3+
UNNEST(ARRAY [
4+
COUNT(1) FILTER (WHERE income > 50000),
5+
COUNT(1) FILTER (WHERE income < 20000) ,
6+
COUNT(1) FILTER (WHERE income BETWEEN 20000 AND 50000)
7+
]) accounts_count
8+
FROM accounts

0 commit comments

Comments
 (0)