[SQL문제풀기] 3월에 태어난 여성 회원 목록 출력하기 (SELECT)

241223
이나겸's avatar
Dec 23, 2024
[SQL문제풀기] 3월에 태어난 여성 회원 목록 출력하기 (SELECT)
Contents
Q. 풀이

Q.

notion image
 
 

풀이

  • date_format(date_of_birth, '%Y-%m-%d')
    • date_of_birth를 YYYY-mm-dd로 날짜 형식 포맷
  • month(date_of_birth)
    • date_of_birth의 달만 나타낼 수 있음
  • is not null
    • null이 아님
  • order by member_id asc
    • member_id 기준 오름차순 정렬
select member_id, member_name, gender, date_format(date_of_birth, '%Y-%m-%d') as date_of_birth from member_profile where month(date_of_birth) = 3 and gender = 'W' and tlno is not null order by member_id asc;
Share article

Nakyeom's Study