Check out example codes for "sql avg and group by". It will help you in understanding the concepts better.

Code Example 1

SELECT
  AVG(depdelay),
  origin
FROM flight_delays
WHERE distance > 2000
GROUP BY origin;

Learn ReactJs, React Native from akashmittal.com