반응형
2023년 04월 16일 기준 (문제 업데이트 중)
3월에 태어난 여성 회원 목록 출력하기 (LEVEL 2)
https://school.programmers.co.kr/learn/courses/30/lessons/131120
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 NOT TLNO IS NULL
ORDER BY MEMBER_ID ASC
재구매가 일어난 상품과 회원 리스트 구하기 (LEVEL 2)
https://school.programmers.co.kr/learn/courses/30/lessons/131536
SELECT USER_ID, PRODUCT_ID
FROM ONLINE_SALE
GROUP BY USER_ID, PRODUCT_ID
HAVING COUNT(*)>1
ORDER BY USER_ID ASC, PRODUCT_ID DESC
서울에 위치한 식당 목록 출력하기 (LEVEL 4)
https://school.programmers.co.kr/learn/courses/30/lessons/131118
SELECT A.REST_ID, B.REST_NAME, B.FOOD_TYPE, B.FAVORITES, B.ADDRESS, ROUND(AVG(A.REVIEW_SCORE),2) AS SCORE
FROM REST_REVIEW AS A
JOIN REST_INFO AS B ON A.REST_ID=B.REST_ID
GROUP BY A.REST_ID
HAVING B.ADDRESS LIKE '서울%'
ORDER BY SCORE DESC, B.FAVORITES DESC
오프라인/온라인 판매 데이터 통합하기 (LEVEL 4)
https://school.programmers.co.kr/learn/courses/30/lessons/131537
SELECT DATE_FORMAT(SALES_DATE, '%Y-%m-%d') AS SALES_DATE, PRODUCT_ID, USER_ID,SALES_AMOUNT
FROM ONLINE_SALE
WHERE MONTH(SALES_DATE)=3
UNION ALL
SELECT DATE_FORMAT(SALES_DATE, '%Y-%m-%d') AS SALES_DATE, PRODUCT_ID, NULL AS USER_ID,SALES_AMOUNT
FROM OFFLINE_SALE
WHERE MONTH(SALES_DATE)=3
ORDER BY SALES_DATE ASC, PRODUCT_ID ASC, USER_ID ASC
반응형
'Problem Solving > SQL고득점KIT' 카테고리의 다른 글
프로그래머스 SQL 고득점 KIT - SELECT (LEVEL 1) (0) | 2023.04.16 |
---|