Check out example codes for "sql sum and other fields". It will help you in understanding the concepts better.

Code Example 1

SELECT sum(a) as car,b,c FROM toys 
GROUP BY b, c

Learn ReactJs, React Native from akashmittal.com