vimwiki

Query command

AVG

Give the average.

SELECT AVG(grade)
FROM grades;

COUNT

SELECT COUNT(*) FROM student;

SELECT COUNT(DISTINCT(car_model)) from car;

used with distinct, it will not count duplicate.

LOWER/UPPER

String function that convert character to lower/upper case

SELECT UPPER(name) FROM student;
SELECT LOWER(name) FROM student;

MIN/MAX

Return the min/max value from a column. Also work with string (return based on the number of character).

SELECT MAX(grade) FROM grade;