The power of SQL and SQLite does not end just in simple CRUD operations. SQLite exposes a number of useful functions that can be utilized to obtain even more meaningful insights from your data.
Some of the functions that we will be using to enhance our application are as follows:
- avg(X): Returns the average of all values passed to it
- max(X): Returns the maximum value out of the values passed to it
- min(X): Returns the minimum value out of the values passed to it
- count(X): Returns the total number of values passed to it
Here, X denotes the column name to be aggregated.
Most of the functions provided by SQLite work on both text as well as numeric input. For example, max and min would also work on text input by ordering the provided values alphabetically. However, some functions (such as avg) may not make sense for text inputs, and although they return a result, they...