Ravindra BagaleCourses & study guides Track your progress

GROUP BY: One Row Per Group — Ravi Sir's Cards

All SQL cards

Revision cards

GROUP BY gives one row per group. A city report needs one total for each city, not one big mixed total.
GROUP BY gives one row per group · PNG

Interview cards

Why do we use GROUP BY city with SUM(amount)? So that each city gets its own total, just like a PivotTable in Excel.
Why do we use GROUP BY city with SUM(amount)? · PNG

Comparison cards

WHERE vs HAVING. WHERE filters single rows before grouping. HAVING filters whole groups after the totals are calculated.
WHERE vs HAVING · PNG