#110. [LeetCode / MySQL] 1907. Count Salary Categories

문제

 

입력 코드

(SELECT "Low Salary" AS category,
    (SELECT COUNT(account_id)
     FROM Accounts
     WHERE income < 20000) AS accounts_count)
UNION ALL
(SELECT "Average Salary" AS category,
    (SELECT COUNT(account_id)
     FROM Accounts
     WHERE income >= 20000 and income <= 50000) AS accounts_count)
UNION ALL
(SELECT "High Salary" AS category,
    (SELECT COUNT(account_id)
     FROM Accounts
     WHERE income > 50000) AS accounts_count)

 

코드 설명

#SELECT #COUNT #UNION #UNION ALL

 

 

문제 출처

 

LeetCode - The World's Leading Online Programming Learning Platform

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com