Skip to content

Commit

Permalink
SQL/SELECT: 3월에 태어난 여성 회원 목록 출력하기 (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieunnnn committed Nov 23, 2023
1 parent b9bfcfe commit 81a0769
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/programmers/sql/SELECT_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- MEMBER_PROFILE 테이블에서 생일이 3월인 여성 회원의 ID, 이름, 성별, 생년월일을 조회하는 SQL문을 작성해주세요.
-- 이때 전화번호가 NULL인 경우는 출력대상에서 제외시켜 주시고, 결과는 회원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;

0 comments on commit 81a0769

Please sign in to comment.