커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
챕터 4-4에서 실습1에 대한 문의 입니다.
엑셀보다 쉽고 빠른 SQL
챕터 4
북마크
김*리
댓글
1
추천
0
조회수
6
조회수
6
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


[지역별]을 추가하여 문제 풀이를 진행하였는데 그림에 나오는 답과 차이가 있습니다. 그림만으로는 정답을 확인하기가 어려워 정답확인 요청드립니다.



스파르타 즉문즉답




작성한 코드 및 에러 메세지

SELECT sido,

cuisine_type,

sum_quantity,

count_of_restaurant,

case when count_of_restaurant>=5 and sum_quantity>=30 then 0.005

when count_of_restaurant>=5 and sum_quantity<30 then 0.008

when count_of_restaurant<5 and sum_quantity>=30 then 0.01

when count_of_restaurant<5 and sum_quantity<30 then 0.02 end ratio_of_add

from

(

SELECT substr(addr,1,2) sido,

cuisine_type,

sum(quantity) sum_quantity,

count(distinct restaurant_name) count_of_restaurant

from food_orders

group by 1, 2

) a

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴