코딩 테스트/SQL

[프로그래머스 - LEVEL 2] 3월에 태어난 여성 회원 목록 출력하기

macbook2 2026. 2. 11. 15:50

https://school.programmers.co.kr/learn/courses/30/lessons/131120

 

프로그래머스

SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr


문제

MEMBER_PROFILE 테이블에서 생일이 3월인 여성 회원의 ID, 이름, 성별, 생년월일을 조회하는 SQL문을 작성해주세요. 이때 전화번호가 NULL인 경우는 출력대상에서 제외시켜 주시고, 결과는 회원ID를 기준으로 오름차순 정렬해주세요.

 

풀이

-- 코드를 입력하세요
SELECT member_id, member_name, gender, date_format(date_of_birth, '%Y-%m-%d') as birth
from member_profile
where month(date_of_birth) = '03' 
    and gender = 'w'
    and tlno is not null
order by member_id;