inblog logo
|
silver
    SQL문제풀기

    [SQL문제풀기] Workers by Department Since April

    silver's avatar
    silver
    Jan 03, 2026
    [SQL문제풀기] Workers by Department Since April
    Contents
    문제내가 작성한 정답

    문제

    StrataScratch - Workers by Department Since April
    StrataScratch
    StrataScratch - Workers by Department Since April
    https://platform.stratascratch.com/coding/9847-find-the-number-of-workers-by-department?code_type=3

    내가 작성한 정답

    MySQL, PostgreSQL

    select department, count(worker_id) "number of workers" from worker where joining_date >= '2014-04-01' group by department order by 2 desc;

    Oracle

    :where joining_date >= '2014-04-01' 이렇게 날짜 비교할 수 없음
    select department, count(worker_id) "number of workers" from worker where to_char(joining_date,'yyyy-mm-dd') >= '2014-04-01' group by department order by 2 desc; select department, count(worker_id) "number of workers" from worker where joining_date >= to_date('2014-04-01','yyyy-mm-dd') group by department order by 2 desc;
    Share article

    silver

    RSS·Powered by Inblog