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

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

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

Chapter 7

Aggregate Functions, GROUP BY, HAVING, and Reporting Queries

Use MariaDB to summarize data for dashboards, reporting, analytics, and operational review.

Inside this chapter

  1. Why Aggregation Matters
  2. Common Aggregate Functions
  3. Grouping by Meaningful Dimensions
  4. Filtering Aggregates with HAVING

Series navigation

Study the chapters in order for the smoothest path from relational foundations to production-level MariaDB operations. Use the navigation at the bottom of each page to move chapter by chapter through the full series.

Tutorial Home

Chapter 7

Why Aggregation Matters

Applications often need more than raw rows. Teams want totals, averages, maximum values, monthly counts, and grouped reports. MariaDB can calculate these efficiently close to the data, which reduces application-side loops and improves clarity.

Chapter 7

Common Aggregate Functions

  • COUNT() counts rows
  • SUM() totals numeric values
  • AVG() computes averages
  • MIN() and MAX() find boundaries
SELECT COUNT(*) AS total_customers
FROM customers
WHERE status = 'ACTIVE';
Chapter 7

Grouping by Meaningful Dimensions

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

Grouping lets you summarize by status, department, region, product category, month, assignee, or any other useful dimension. This is the basis of many management dashboards.

Chapter 7

Filtering Aggregates with HAVING

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

WHERE filters rows before grouping. HAVING filters grouped results after aggregation. Understanding that distinction prevents many beginner mistakes.

Copyright © 2026, WithoutBook.