Q. What does the GROUP BY clause do in a SQL query?

A
Sorts the results in ascending order
B
Groups rows that have the same values in specified columns into summary rows
C
Filters rows based on a condition
D
Joins multiple tables
Solution:

GROUP BY is used with aggregate functions (e.g., COUNT, SUM) to group rows based on common values in one or more columns.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!