SQL 알고리즘 코드카타

SQL 알고리즘 코드카타 15일차(3) 26.01.13(화)

nom_de_plume 2026. 1. 13. 10:06

부제:

3월에 태어난 여성 회원 목록 출력하기, 레벨 3

 

1. 문제 링크:https://school.programmers.co.kr/learn/courses/30/lessons/131120
2. 정답 코드: 

SELECT
    member_id,
    member_name,
    gender,
    date_format(date_of_birth, '%Y-%m-%d') as date_of_birth
from member_profile
where date_of_birth like '%-03-%' 
    and gender='W' 
    and tlno is not null
order by member_id asc


3. 오류 상황:

SELECT
    member_id,
    member_name,
    gender,
    date_format(date_of_birth, '%Y-%m-%d') as date_of_birth
from member_profile
where tlno is not null
order by member_id asc

=> 조건 누락
4. 시도 방법: WHERE문에 조건 추가
5. 최종 문제 해결 방법: WHERE문에 3월달에 태어난 조건과 여성이라는 조건을 추가