[SQL문제풀기] April Admin Employees

silver's avatar
Jan 04, 2026
[SQL문제풀기] April Admin Employees

문제

내가 작성한 정답

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