#02. SELECT : 과일로 만든 아이스크림 고르기 | 프로그래머스 | SQL 고득점 Kit

문제

 

입력 코드

1. JOIN

SELECT 
    shipment.FLAVOR
FROM FIRST_HALF AS shipment
    JOIN ICECREAM_INFO AS info
    ON shipment.FLAVOR = info.FLAVOR
WHERE (shipment.TOTAL_ORDER > 3000)
        AND (info.INGREDIENT_TYPE = 'fruit_based')
ORDER BY shipment.TOTAL_ORDER DESC;

 

2. SUB QUERY

SELECT FLAVOR
    FROM FIRST_HALF
    WHERE FLAVOR IN
    	(SELECT FLAVOR
    		FROM ICECREAM_INFO
    		WHERE INGREDIENT_TYPE='fruit_based')
    	AND TOTAL_ORDER > 3000
    ORDER BY TOTAL_ORDER DESC

 

 

코드 설명

#SELECT #JOIN #WHERE #ORDER  BY #SUBQUERY

 

 

문제 출처

https://school.programmers.co.kr/learn/courses/30/lessons/133025