Check out example codes for "sum mysql". It will help you in understanding the concepts better.

Code Example 1

SELECT SUM(Quantity) AS TotalItemsOrdered FROM OrderDetails;

Code Example 2

SELECT sum( mark ) FROM `student`

Learn ReactJs, React Native from akashmittal.com