What is the purpose of the SQL GROUP BY clause?

  • Filtering records
  • Grouping similar data
  • Joining tables
  • Sorting records
The SQL GROUP BY clause is used to group rows that have the same values into summary rows, such as "find the number of customers in each city" or "calculate the total sales for each product category." It is typically used with aggregate functions (like COUNT, SUM, AVG, etc.) to perform calculations on each group of data. This clause helps in analyzing data by organizing it into manageable chunks based on specified criteria.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *