We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b09e46f commit 759f3d9Copy full SHA for 759f3d9
database/medium/count_salary_categories.sql
@@ -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