๋ฐ˜์‘ํ˜•

๐Ÿ’ SQL (Programmers)/Group By 23

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ๋…ธ์„ ๋ณ„ ํ‰๊ท  ์—ญ ์‚ฌ์ด ๊ฑฐ๋ฆฌ ์กฐํšŒํ•˜๊ธฐ (284531)

https://school.programmers.co.kr/learn/courses/30/lessons/284531 ํ”„๋กœ๊ทธ๋ž˜๋จธ์ŠคSW๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ํ‰๊ฐ€, ๊ต์œก, ์ฑ„์šฉ๊นŒ์ง€ Total Solution์„ ์ œ๊ณตํ•˜๋Š” ๊ฐœ๋ฐœ์ž ์„ฑ์žฅ์„ ์œ„ํ•œ ๋ฒ ์ด์Šค์บ ํ”„programmers.co.kr ๋ฌธ์ œSUBWAY_DISTANCE ํ…Œ์ด๋ธ”์—์„œ ๋…ธ์„ ๋ณ„๋กœ ๋…ธ์„ , ์ด ๋ˆ„๊ณ„ ๊ฑฐ๋ฆฌ, ํ‰๊ท  ์—ญ ์‚ฌ์ด ๊ฑฐ๋ฆฌ๋ฅผ ๋…ธ์„ ๋ณ„๋กœ ์กฐํšŒํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.์ด ๋ˆ„๊ณ„๊ฑฐ๋ฆฌ๋Š” ํ…Œ์ด๋ธ” ๋‚ด ์กด์žฌํ•˜๋Š” ์—ญ๋“ค์˜ ์—ญ ์‚ฌ์ด ๊ฑฐ๋ฆฌ์˜ ์ด ํ•ฉ์„ ๋œปํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ˆ„๊ณ„ ๊ฑฐ๋ฆฌ์™€ ํ‰๊ท  ์—ญ ์‚ฌ์ด ๊ฑฐ๋ฆฌ์˜ ์ปฌ๋Ÿผ๋ช…์€ ๊ฐ๊ฐ TOTAL_DISTANCE, AVERAGE_DISTANCE๋กœ ํ•ด์ฃผ์‹œ๊ณ ,์ด ๋ˆ„๊ณ„๊ฑฐ๋ฆฌ๋Š” ์†Œ์ˆ˜ ๋‘˜์งธ์ž๋ฆฌ์—์„œ, ํ‰๊ท  ์—ญ ์‚ฌ์ด ๊ฑฐ๋ฆฌ๋Š” ์†Œ์ˆ˜ ์…‹์งธ ์ž๋ฆฌ์—์„œ ๋ฐ˜์˜ฌ๋ฆผ ํ•œ ๋’ค ๋‹จ์œ„(km)๋ฅผ ํ•จ๊ป˜ ..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ํŠน์ • ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋Š” ๋ฌผ๊ณ ๊ธฐ๋ณ„ ์ˆ˜์™€ ์ตœ๋Œ€ ๊ธธ์ด ๊ตฌํ•˜๊ธฐ (298519)

https://school.programmers.co.kr/learn/courses/30/lessons/298519 ํ”„๋กœ๊ทธ๋ž˜๋จธ์ŠคSW๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ํ‰๊ฐ€, ๊ต์œก, ์ฑ„์šฉ๊นŒ์ง€ Total Solution์„ ์ œ๊ณตํ•˜๋Š” ๊ฐœ๋ฐœ์ž ์„ฑ์žฅ์„ ์œ„ํ•œ ๋ฒ ์ด์Šค์บ ํ”„programmers.co.kr ๋ฌธ์ œFISH_INFO์—์„œ ํ‰๊ท  ๊ธธ์ด๊ฐ€ 33cm ์ด์ƒ์ธ ๋ฌผ๊ณ ๊ธฐ๋“ค์„์ข…๋ฅ˜๋ณ„๋กœ ๋ถ„๋ฅ˜ํ•˜์—ฌ์žก์€ ์ˆ˜, ์ตœ๋Œ€ ๊ธธ์ด, ๋ฌผ๊ณ ๊ธฐ์˜ ์ข…๋ฅ˜๋ฅผ ์ถœ๋ ฅํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.๊ฒฐ๊ณผ๋Š” ๋ฌผ๊ณ ๊ธฐ ์ข…๋ฅ˜์— ๋Œ€ํ•ด ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌํ•ด์ฃผ์‹œ๊ณ ,10cm์ดํ•˜์˜ ๋ฌผ๊ณ ๊ธฐ๋“ค์€ 10cm๋กœ ์ทจ๊ธ‰ํ•˜์—ฌ ํ‰๊ท  ๊ธธ์ด๋ฅผ ๊ตฌํ•ด์ฃผ์„ธ์š”. ์ปฌ๋Ÿผ๋ช…์€ ๋ฌผ๊ณ ๊ธฐ์˜ ์ข…๋ฅ˜ 'FISH_TYPE', ์žก์€ ์ˆ˜ 'FISH_COUNT', ์ตœ๋Œ€ ๊ธธ์ด 'MAX_LENGTH'๋กœ ํ•ด์ฃผ์„ธ์š”. ํ’€์ดselect count(ID) as FISH..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ์—ฐ๊ฐ„ ํ‰๊ฐ€์ ์ˆ˜์— ํ•ด๋‹นํ•˜๋Š” ํ‰๊ฐ€ ๋“ฑ๊ธ‰ ๋ฐ ์„ฑ๊ณผ๊ธˆ ์กฐํšŒํ•˜๊ธฐ (284528)

https://school.programmers.co.kr/learn/courses/30/lessons/284528 ํ”„๋กœ๊ทธ๋ž˜๋จธ์ŠคSW๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ํ‰๊ฐ€, ๊ต์œก, ์ฑ„์šฉ๊นŒ์ง€ Total Solution์„ ์ œ๊ณตํ•˜๋Š” ๊ฐœ๋ฐœ์ž ์„ฑ์žฅ์„ ์œ„ํ•œ ๋ฒ ์ด์Šค์บ ํ”„programmers.co.kr ๋ฌธ์ œHR_DEPARTMENT, HR_EMPLOYEES, HR_GRADE ํ…Œ์ด๋ธ”์„ ์ด์šฉํ•ด ์‚ฌ์›๋ณ„ ์„ฑ๊ณผ๊ธˆ ์ •๋ณด๋ฅผ ์กฐํšŒํ•˜๋ คํ•ฉ๋‹ˆ๋‹ค.ํ‰๊ฐ€ ์ ์ˆ˜๋ณ„ ๋“ฑ๊ธ‰๊ณผ ๋“ฑ๊ธ‰์— ๋”ฐ๋ฅธ ์„ฑ๊ณผ๊ธˆ ์ •๋ณด๊ฐ€ ์•„๋ž˜์™€ ๊ฐ™์„ ๋•Œ, ์‚ฌ๋ฒˆ, ์„ฑ๋ช…, ํ‰๊ฐ€ ๋“ฑ๊ธ‰, ์„ฑ๊ณผ๊ธˆ์„ ์กฐํšŒํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.ํ‰๊ฐ€๋“ฑ๊ธ‰์˜ ์ปฌ๋Ÿผ๋ช…์€ GRADE๋กœ, ์„ฑ๊ณผ๊ธˆ์˜ ์ปฌ๋Ÿผ๋ช…์€ BONUS๋กœ ํ•ด์ฃผ์„ธ์š”.๊ฒฐ๊ณผ๋Š” ์‚ฌ๋ฒˆ ๊ธฐ์ค€์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”. ---๊ธฐ์ค€ ์ ์ˆ˜ ํ‰๊ฐ€ ๋“ฑ๊ธ‰ ์„ฑ๊ณผ๊ธˆ(์—ฐ๋ด‰ ๊ธฐ์ค€)96 ์ด์ƒ S 20%90 ์ด..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ์กฐ๊ฑด์— ๋งž๋Š” ์‚ฌ์› ์ •๋ณด ์กฐํšŒํ•˜๊ธฐ (284527)

https://school.programmers.co.kr/learn/courses/30/lessons/284527 ๋ฌธ์ œHR_DEPARTMENT, HR_EMPLOYEES, HR_GRADE ํ…Œ์ด๋ธ”์—์„œ 2022๋…„๋„ ํ•œํ•ด ํ‰๊ฐ€ ์ ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ๋†’์€ ์‚ฌ์› ์ •๋ณด๋ฅผ ์กฐํšŒํ•˜๋ ค ํ•ฉ๋‹ˆ๋‹ค. 2022๋…„๋„ ํ‰๊ฐ€ ์ ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ๋†’์€ ์‚ฌ์›๋“ค์˜ ์ ์ˆ˜, ์‚ฌ๋ฒˆ, ์„ฑ๋ช…, ์ง์ฑ…, ์ด๋ฉ”์ผ์„ ์กฐํšŒํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.2022๋…„๋„์˜ ํ‰๊ฐ€ ์ ์ˆ˜๋Š” ์ƒ,ํ•˜๋ฐ˜๊ธฐ ์ ์ˆ˜์˜ ํ•ฉ์„ ์˜๋ฏธํ•˜๊ณ , ํ‰๊ฐ€ ์ ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ปฌ๋Ÿผ์˜ ์ด๋ฆ„์€ SCORE๋กœ ํ•ด์ฃผ์„ธ์š”. ํ’€์ดselect s.SCORE, e.EMP_NO, e.EMP_NAME, e.POSITION, e.EMAILfrom HR_EMPLOYEES e join ( select EMP_NO, sum(..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ์›”๋ณ„ ์žก์€ ๋ฌผ๊ณ ๊ธฐ ์ˆ˜ ๊ตฌํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/293260 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”.programmers.co.kr ๋ฌธ์ œ์›”๋ณ„ ์žก์€ ๋ฌผ๊ณ ๊ธฐ์˜ ์ˆ˜์™€ ์›”์„ ์ถœ๋ ฅํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.์žก์€ ๋ฌผ๊ณ ๊ธฐ ์ˆ˜ ์ปฌ๋Ÿผ๋ช…์€ FISH_COUNT, ์›” ์ปฌ๋Ÿผ๋ช…์€ MONTH๋กœ ํ•ด์ฃผ์„ธ์š”.๊ฒฐ๊ณผ๋Š” ์›”์„ ๊ธฐ์ค€์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”.๋‹จ, ์›”์€ ์ˆซ์žํ˜•ํƒœ (1~12) ๋กœ ์ถœ๋ ฅํ•˜๋ฉฐ 9 ์ดํ•˜์˜ ์ˆซ์ž๋Š” ๋‘ ์ž๋ฆฌ๋กœ ์ถœ๋ ฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์žก์€ ๋ฌผ๊ณ ๊ธฐ๊ฐ€ ์—†๋Š” ์›”์€ ์ถœ๋ ฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ’€์ดselect count(ID) as FISH_COUNT, month(T..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ๋ถ€์„œ๋ณ„ ํ‰๊ท  ์—ฐ๋ด‰ ์กฐํšŒํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/284529 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”.programmers.co.kr ๋ฌธ์ œHR_DEPARTMENT์™€ HR_EMPLOYEES ํ…Œ์ด๋ธ”์„ ์ด์šฉํ•ด ๋ถ€์„œ๋ณ„ ํ‰๊ท  ์—ฐ๋ด‰์„ ์กฐํšŒํ•˜๋ ค ํ•ฉ๋‹ˆ๋‹ค.  ๋ถ€์„œ๋ณ„๋กœ ๋ถ€์„œ ID, ์˜๋ฌธ ๋ถ€์„œ๋ช…, ํ‰๊ท  ์—ฐ๋ด‰์„ ์กฐํšŒํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.ํ‰๊ท ์—ฐ๋ด‰์€ ์†Œ์ˆ˜์  ์ฒซ์งธ ์ž๋ฆฌ์—์„œ ๋ฐ˜์˜ฌ๋ฆผํ•˜๊ณ  ์ปฌ๋Ÿผ๋ช…์€ AVG_SAL๋กœ ํ•ด์ฃผ์„ธ์š”.๊ฒฐ๊ณผ๋Š” ๋ถ€์„œ๋ณ„ ํ‰๊ท  ์—ฐ๋ด‰์„ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”. ํ’€์ดselect e.DEPT_ID, d.DEPT_NAME_EN, round(..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ๋ฌผ๊ณ ๊ธฐ ์ข…๋ฅ˜ ๋ณ„ ์žก์€ ์ˆ˜ ๊ตฌํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/293257 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”.programmers.co.kr ๋ฌธ์ œFISH_NAME_INFO์—์„œ ๋ฌผ๊ณ ๊ธฐ์˜ ์ข…๋ฅ˜ ๋ณ„ ๋ฌผ๊ณ ๊ธฐ์˜ ์ด๋ฆ„๊ณผ ์žก์€ ์ˆ˜๋ฅผ ์ถœ๋ ฅํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.๋ฌผ๊ณ ๊ธฐ์˜ ์ด๋ฆ„ ์ปฌ๋Ÿผ๋ช…์€ FISH_NAME, ์žก์€ ์ˆ˜ ์ปฌ๋Ÿผ๋ช…์€ FISH_COUNT๋กœ ํ•ด์ฃผ์„ธ์š”.๊ฒฐ๊ณผ๋Š” ์žก์€ ์ˆ˜ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”. ํ’€์ดFISH_INFO์™€ FISH_NAME_INFO ๋ฅผ join ํ•ด์ฃผ๊ณ FISH_NAME์œผ๋กœ group by ํ•ด์ฃผ๋ฉด ๋select count(i.ID) a..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ์ €์ž ๋ณ„ ์นดํ…Œ๊ณ ๋ฆฌ ๋ณ„ ๋งค์ถœ์•ก ์ง‘๊ณ„ํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/144856 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr 2022๋…„ 1์›”์˜ ๋„์„œ ํŒ๋งค ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ €์ž ๋ณ„, ์นดํ…Œ๊ณ ๋ฆฌ ๋ณ„ ๋งค์ถœ์•ก(TOTAL_SALES = ํŒ๋งค๋Ÿ‰ * ํŒ๋งค๊ฐ€) ์„ ๊ตฌํ•˜์—ฌ, ์ €์ž ID(AUTHOR_ID), ์ €์ž๋ช…(AUTHOR_NAME), ์นดํ…Œ๊ณ ๋ฆฌ(CATEGORY), ๋งค์ถœ์•ก(SALES) ๋ฆฌ์ŠคํŠธ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ๊ฒฐ๊ณผ๋Š” ์ €์ž ID๋ฅผ ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ, ์ €์ž ID๊ฐ€ ๊ฐ™๋‹ค๋ฉด ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”. select b.au..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ๋…„, ์›”, ์„ฑ๋ณ„ ๋ณ„ ์ƒํ’ˆ ๊ตฌ๋งค ํšŒ์› ์ˆ˜ ๊ตฌํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/131532 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr USER_INFO ํ…Œ์ด๋ธ”๊ณผ ONLINE_SALE ํ…Œ์ด๋ธ”์—์„œ ๋…„, ์›”, ์„ฑ๋ณ„ ๋ณ„๋กœ ์ƒํ’ˆ์„ ๊ตฌ๋งคํ•œ ํšŒ์›์ˆ˜๋ฅผ ์ง‘๊ณ„ํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ๊ฒฐ๊ณผ๋Š” ๋…„, ์›”, ์„ฑ๋ณ„์„ ๊ธฐ์ค€์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”. ์ด๋•Œ, ์„ฑ๋ณ„ ์ •๋ณด๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ ๊ฒฐ๊ณผ์—์„œ ์ œ์™ธํ•ด์ฃผ์„ธ์š”. select year(sales_date) as year, month(sales_date) as month, gender, count(distinct..

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค][SQL] ์‹ํ’ˆ๋ถ„๋ฅ˜๋ณ„ ๊ฐ€์žฅ ๋น„์‹ผ ์‹ํ’ˆ์˜ ์ •๋ณด ์กฐํšŒํ•˜๊ธฐ

https://school.programmers.co.kr/learn/courses/30/lessons/131116 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr FOOD_PRODUCT ํ…Œ์ด๋ธ”์—์„œ ์‹ํ’ˆ๋ถ„๋ฅ˜๋ณ„๋กœ ๊ฐ€๊ฒฉ์ด ์ œ์ผ ๋น„์‹ผ ์‹ํ’ˆ์˜ ๋ถ„๋ฅ˜, ๊ฐ€๊ฒฉ, ์ด๋ฆ„์„ ์กฐํšŒํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ์ด๋•Œ ์‹ํ’ˆ๋ถ„๋ฅ˜๊ฐ€ '๊ณผ์ž', '๊ตญ', '๊น€์น˜', '์‹์šฉ์œ '์ธ ๊ฒฝ์šฐ๋งŒ ์ถœ๋ ฅ์‹œ์ผœ ์ฃผ์‹œ๊ณ  ๊ฒฐ๊ณผ๋Š” ์‹ํ’ˆ ๊ฐ€๊ฒฉ์„ ๊ธฐ์ค€์œผ๋กœ ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌํ•ด์ฃผ์„ธ์š”. -- ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” select category, price as max_price, product_name from food_pro..

๋ฐ˜์‘ํ˜•