Skip to Content
Head First SQL (Korean Edition), 2nd Edition
book

Head First SQL (Korean Edition), 2nd Edition

by Kimberly Fessel
June 2026
740 pages
14h 34m
Korean
O'Reilly Media, Inc.
Content preview from Head First SQL (Korean Edition), 2nd Edition

제6장. 고급 SELECT: 정렬 및 집계

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

Image

이제 SELECT 문을 한 단계 더 발전시킬 때입니다. 데이터 SELECT 방법과 WHERE 절 사용법은 이미 알고 계실 것입니다. 하지만 때로는 SELECT와 WHERE만으로는 달성하기 어려운, 좀 더 높은 수준의 쿼리가 필요할 때가 있습니다.

이 장에서는 다음을 배우게 됩니다. 데이터를 여러 가지 방법으로 데이터를 정렬하는 방법을 배우게 됩니다. 또한 수학적 계산값을 집계하는을 생성하게 될 것입니다. 그리고 혹시 새로운 범주가 필요하다면, if-then-else 논리를 활용해 자신만의 분류 체계를 구축하는 방법을 배우게 될 것입니다. SELECT로 도약해 봅시다!

여기저기 둘러보기

지난 장이 끝난 이후로, 여러분의 친구 조쉬는 정말 바쁘게 지내고 있습니다.

Image

다음은 stores 테이블의 일부입니다. 조시는 가게를 방문한 순서대로 행을 삽입했습니다.

Image

ORDER (BY)가 등장합니다!

쿼리 결과를 정렬해야 한다고요? 마침 SQL에 특정 항목을 SELECT하고, 반환된 데이터를 테이블의 특정 열 기준으로 ORDER BY를 지정해 정렬하도록 지시할 수 있습니다.

조쉬가 모든 업체를 알파벳 순서로, 업체 유형과 함께 가져오는 방법은 다음과 같습니다:

Image

ORDER BY 절은 행들이 이름의 알파벳 순서대로 반환된다는 뜻입니다:

Image

ORDER BY를 사용하면 어떤 열을 기준으로든 결과를 알파벳 순서로 정렬할 수 있습니다.

WHERE와 함께 사용하는 ORDER

물론 가능합니다. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Tips for Designing Effective Presentation Slide Decks

Tips for Designing Effective Presentation Slide Decks

Curtis Newbold
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
How to Overcome a Power Deficit

How to Overcome a Power Deficit

Cyril Bouquet, Jean-Louis Barsoux
Relational Power Is the New Currency of Hybrid Work

Relational Power Is the New Currency of Hybrid Work

Lebene Soga, Yemisi Bolade-Ogunfodun, Nazrul Islam, Joseph Amankwah-Amoah

Publisher Resources

ISBN: 0642572408091