Important SQL Functions

Arithmetic OperatorsExample
Addition (+)Used to add two values togetherEX: =QUERY(data!A1:L,”SELECT G, J, K, J + K)
Subtraction (-)Used to subtract one value from anotherEX: =QUERY(data!A1:L,”SELECT G, J, K, J – K)
Multiplication (*)Used to multiply two values togetherEX: =QUERY(data!A1:L,”SELECT G, J, K, J * K)
Division (/)Used to divide one value by anotherEX: =QUERY(data!A1:L,”SELECT G, J, K, J / K)
Aggregate Functions
SUMTotals or sums all values in a selected range
COUNTReturns the number of non-null values from a selected range
AVGCalculates the average value of a selected range
MINReturns the smallest value from a selected range
MAXReturns the largest value from a selected range
GROUP BY Function
GROUP BYGROUP BY is used to create different groups within a single column so we can aggregate those groups.
Examples of SQL functions for Google sheets

Leave a Reply