가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Chapter 7

Aggregate Functions, GROUP BY, HAVING, and Analytic Functions

Use Oracle DB for summaries, reporting, rankings, running calculations, and analytical-style SQL.

Inside this chapter

  1. Why Aggregation Matters
  2. Core Aggregate Functions
  3. Filtering Aggregated Results
  4. Analytic Functions for Advanced SQL

Series navigation

Study the chapters in order for the clearest path from Oracle SQL basics to PL/SQL, recovery, tuning, and enterprise operations. Use the navigation at the bottom of each page to move through the full series.

Tutorial Home

Chapter 7

Why Aggregation Matters

Business teams want totals, averages, status counts, top performers, trends, and grouped summaries. Oracle SQL can compute these directly and efficiently close to the data.

Chapter 7

Core Aggregate Functions

SELECT
    order_status,
    COUNT(*) AS total_orders
FROM orders
GROUP BY order_status;

Functions like COUNT, SUM, AVG, MIN, and MAX are the building blocks of reporting SQL.

Chapter 7

Filtering Aggregated Results

SELECT
    customer_id,
    COUNT(*) AS total_orders
FROM orders
GROUP BY customer_id
HAVING COUNT(*) >= 5;

HAVING filters grouped results after aggregation, while WHERE filters detail rows first.

Chapter 7

Analytic Functions for Advanced SQL

SELECT
    order_id,
    customer_id,
    order_date,
    ROW_NUMBER() OVER (
        PARTITION BY customer_id
        ORDER BY order_date DESC
    ) AS customer_order_rank
FROM orders;

Oracle analytic functions are extremely powerful. They support ranking, running totals, lag/lead comparisons, and advanced reporting patterns without collapsing all detail rows. These are essential for advanced SQL work.

Copyright © 2026, WithoutBook.