What is the purpose of the GROUP BY statement in SQL?

  • To arrange records in ascending order
  • To filter records based on a condition
  • To group records with similar values in one or more columns
  • To join tables in a query
The GROUP BY statement in SQL is used to group records that have the same values in one or more columns. It is often used with aggregate functions (like COUNT, SUM, AVG) to perform calculations on each group of records. This is particularly useful for data analysis and summary reporting.
Add your answer
Loading...

Leave a comment

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