[프로그래머스 SQL 고득점 Kit] SUM, MAX, MIN: 가장 비싼 상품 구하기
문제 정답 SELECT COUNT(*) AS USERS FROM USER_INFO WHERE AGE BETWEEN 20 AND 29 AND YEAR(JOINED) = 2021
문제 정답 SELECT COUNT(*) AS USERS FROM USER_INFO WHERE AGE BETWEEN 20 AND 29 AND YEAR(JOINED) = 2021
문제 정답 SELECT * FROM FOOD_PRODUCT WHERE PRICE = (SELECT MAX(PRICE) FROM FOOD_PRODUCT)2021
문제 정답 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) = 03 AND TLNO != 'NULL' AND GENDER = 'W' ORDER BY MEMBER_ID
문제 정답 SELECT A.FLAVOR FROM FIRST_HALF AS A JOIN ICECREAM_INFO AS B ON A.FLAVOR = B.FLAVOR WHERE A.TOTAL_ORDER >= 3000 AND B.INGREDIENT_TYPE = 'fruit_based'
문제 정답 SELECT PT_NAME, PT_NO, GEND_CD, AGE, IFNULL(TLNO, 'NONE') AS TLNO FROM PATIENT WHERE AGE
문제 정답 SELECT DR_NAME, DR_ID, MCDP_CD, DATE_FORMAT(HIRE_YMD, '%Y-%m-%d') AS HIRE_YMD FROM DOCTOR WHERE MCDP_CD = 'CS' OR MCDP_CD = 'GS' ORDER BY HIRE_YMD DESC, DR_NAME ASC
문제 정답 SELECT ROUND(AVG(DAILY_FEE)) AS AVERAGE_FEE FROM CAR_RENTAL_COMPANY_CAR WHERE CAR_TYPE = 'SUV'
문제 정답 SELECT FLAVOR FROM FIRST_HALF ORDER BY TOTAL_ORDER DESC, SHIPMENT_ID ASC
문제 정답 SELECT A.REST_ID, A.REST_NAME, A.FOOD_TYPE, A.FAVORITES, A.ADDRESS , ROUND(AVG(B.REVIEW_SCORE), 2) AS SCORE FROM REST_INFO AS A JOIN REST_REVIEW AS B ON A.REST_ID = B.REST_ID WHERE ADDRESS LIKE '서울%' GROUP BY REST_ID ORDER BY SCORE DESC, A.FAVORITES DESC
문제 정답 SELECT A.TITLE, B.BOARD_ID, B.REPLY_ID, B.WRITER_ID, B.CONTENTS, DATE_FORMAT(B.CREATED_DATE, '%Y-%m-%d') AS CREATED_DATE FROM USED_GOODS_BOARD AS A RIGHT JOIN USED_GOODS_REPLY AS B ON A.BOARD_ID = B.BOARD_ID WHERE A.CREATED_DATE LIKE '%2022-10%' ORDER BY B.CREATED_DATE, A.TITLE