Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Function AVG
Functions SUM, MAX, MIN
32. Summary


OK, it's time to review what we've learned in this part.

  • COUNT(*) counts the number of all rows.
  • COUNT(column1) counts the number of rows where column1 is not NULL.
  • COUNT can be used to count non-NULL expressions.
  • Avoid COUNT(*) with LEFT JOINs.
  • DISTINCT only takes into account distinct values.
  • AVG, SUM, MAX and MIN ignore NULLs, but COUNT takes them into account when counting the number of rows.
  • You can use COALESCE(x,y) to replace x with y when x is NULL. For example, you can replace NULLs with 0.
  • You can use AVG, SUM, MIN or MAX with DISTINCT.
  • You can use ROUND to round the score obtained with AVG.

All right! Are you ready for some practice?


Click Next exercise to start our practice.