Practice GROUP BY by adding each category's non-NULL amounts before checking the query output.

highlighted = computed this step

Input table

First sort the rows in your head into book and pen buckets.

try category buckets\text{try category buckets}
Salesorder_idcategoryamounto1book20o2book35o3pen5o4penNULLo5pen20

Group query

For each bucket, add the known amount values; leave the NULL amount out of the sum.

compute sums by hand\text{compute sums by hand}
GROUP BY category sum exercisegroup_byarity 2 rows 2Salesarity 3 rows 5

Grouped output

Compare your hand totals with the grouped output.

check SUM(amount)\text{check SUM(amount)}
Grouped outputcategorytotal_amountbook55pen25