부제:
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월달에 태어난 조건과 여성이라는 조건을 추가
'SQL 알고리즘 코드카타' 카테고리의 다른 글
| SQL 알고리즘 코드카타 16일차(2) 26.01.14(수) (0) | 2026.01.14 |
|---|---|
| SQL 알고리즘 코드카타 16일차(1) 26.01.14(수) (0) | 2026.01.14 |
| SQL 알고리즘 코드카타 15일차(2) 26.01.13(화) (0) | 2026.01.13 |
| SQL 알고리즘 코드카타 15일차(1) 26.01.13(화) (0) | 2026.01.13 |
| SQL 알고리즘 코드카타 14일차(3) 26.01.12(월) (1) | 2026.01.12 |