inblog logo
|
silver
    SQL문제풀기

    [SQL문제풀기] April Admin Employees

    silver's avatar
    silver
    Jan 04, 2026
    [SQL문제풀기] April Admin Employees
    Contents
    문제내가 작성한 정답

    문제

    StrataScratch - April Admin Employees
    StrataScratch
    StrataScratch - April Admin Employees
    https://platform.stratascratch.com/coding/9845-find-the-number-of-employees-working-in-the-admin-department?code_type=3

    내가 작성한 정답

    Oracle, PostgreSQL, MySQL

    select count(worker_id) "the number of employees" from worker where extract(month from joining_date) >= 4 and department = 'Admin';
     

    MySQL

    select count(worker_id) "the number of employees" from worker where month(joining_date) >= 4 and department = 'Admin';

    PostgreSQL

    select count(worker_id) "the number of employees" from worker where extract(month from joining_date) >= 4 and department = 'Admin';

    Oracle

    : 여기서는 문자와 숫자가 비교가 됐는데 원래라면 위의 postgresql처럼 숫자와 숫자만 비교 가능
    select count(worker_id) "the number of employees" from worker where to_char(joining_date,'mm') >= 4 and department = 'Admin';
    Share article

    silver

    RSS·Powered by Inblog