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

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

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


SQL문을 입력을 해도 계속 오류가 뜨고 결과값이 나오질 않습니다 ㅠㅠ

해설과 똑같이 입력을 해도 해결이 되지 않습니다.



스파르타 즉문즉답




select restaurant_name,

case when price<=5000 then 'price_group1'

when price>5000 and price <=10000 then 'price_group2'

when price>10000 and price <=30000 then 'price_group3'

when price>30000 then 'price_group4' end price_group,

case when age<30 then 'age_group1'

when age between 30 and 39 then 'age_group2'

when age between 40 and 49 then 'age_group3'

else 'age_group4' end age_group

(

select f.restaurant_name,

avg(price) price,

avg(age) age

from food_orders f inner join customers c on f.customer_id=c.customer_id

group by 1

) a

order by 1


SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(

select f.restaurant_name,

    avg(price) price,

    avg(age) age

from fo' at line 10


Error position: line: 9



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