🐥
The Tech Toolbox
Visit My Website!LinkedIn Profile
  • ✍️Introduction
  • ✍️Laptop Setup Guide
  • ✍️Quotes
  • Interview Preparation
    • 🔥Topics To Cover
    • 🔥System Design
    • 🔥Google Interview
      • Data Structures
      • Algorithms
      • System Design
      • Programming Concepts
      • Behavioral
    • 🔥Documents
  • Question Answers
    • ⭐Question Set 1
    • ⭐Question Set 2
    • ⭐Question Set 3
    • ⭐Microservice Architecture
    • ⭐Company-wise
      • Publicis Sapient
        • Core Java Section
        • Solutions & Tools
        • Microservices
        • Mix Questions
      • Mastercard
      • Finicity
  • Notes
    • 🎯Java Fundamentals
      • Time & Space Complexity
      • Design Patterns
      • Collections
      • Java 8 Features
      • JVM Internals
      • Generics
      • Multithreading
    • 🎯Spring Fundamentals
      • Spring Boot
      • Spring AOP
      • Spring Cloud
      • Spring Security
      • Spring Batch
    • 🎯Database
      • Oracle SQL
        • Aggregate Functions
      • MongoDB
        • Commands
        • Aggregate Query
      • Distributed Transaction
    • 🎯Apache Kafka
      • Kafka with Spring Boot
      • Partitions
    • 🎯Redis
    • 🎯Mockito
    • 🎯Docker
      • Commands
    • 🎯Kubernetes
      • Commands
    • 🎯Prometheus
    • 🎯Build Tools
      • Gradle
      • Apache Maven
    • 🎯Architecture
      • API and Integration Strategy
  • ⚓Developer Reference
    • ❄️GCP
    • ❄️Linux
  • Structured Learning Plan
    • 🍉Java Multithreading
    • 🍉Data Structures
    • 🍉Spring AOP
    • 🍉Transaction Management
    • 🍉MongoDB
    • 🍉Design Patterns
    • 🍉System Design
Powered by GitBook
On this page

Was this helpful?

  1. Notes
  2. Database
  3. Oracle SQL

Aggregate Functions

SQL (Structured Query Language) is a standard language used to manage and manipulate relational databases. Aggregate functions and indexes are important features of SQL that help to make database queries more efficient and effective.

Aggregate Functions

Aggregate functions are used to perform calculations on a set of values and return a single value. Here are some of the commonly used aggregate functions in SQL:

COUNT

The COUNT function returns the number of rows that match a specified condition. It can be used with or without a WHERE clause.

Example:

SELECT COUNT(*) FROM customers;

This will return the total number of rows in the 'customers' table.

SUM

The SUM function returns the sum of a numeric column in a table. It can be used with or without a WHERE clause.

Example:

SELECT SUM(price) FROM orders WHERE status='completed';

This will return the total sum of prices for completed orders.

AVG

The AVG function returns the average of a numeric column in a table. It can be used with or without a WHERE clause.

Example:

SELECT AVG(age) FROM employees WHERE department='sales';

This will return the average age of employees in the sales department.

MIN

The MIN function returns the minimum value of a column in a table. It can be used with or without a WHERE clause.

Example:

SELECT MIN(salary) FROM employees WHERE department='finance';

This will return the minimum salary of employees in the finance department.

MAX

The MAX function returns the maximum value of a column in a table. It can be used with or without a WHERE clause.

Example:

SELECT MAX(sales) FROM sales_data WHERE year=2022;

This will return the maximum sales value for the year 2022.

PreviousOracle SQLNextMongoDB

Last updated 2 years ago

Was this helpful?

🎯