SQL

Max (and Min)

grabs from 1 column

table: Networth
| NetWorthInMillions | Yob  |
|--------------------|------|
| 50                 | 1989 |
| 10                 | 1992 |
| 30                 | 1995 |
| 5                  | 1899 |

SELECT MAX(NetWorthInMillions) from Networth;

|    |
|----|
| 50 |

Greatest (and Least)

max per row, across multiple columns

table: Distances
| distance_to_home | distance_to_work |
|------------------|------------------|
| 10               | 20               |
| 5                | 1                |

SELECT GREATEST(distance_to_home, distance_to_work) from Distances

|    |
|----|
| 20 |
| 5  |

Coalesce

returns FIRST non-null argument

Interval

used for analyzing stuff

returns index of the argument that is less than the first argument

In

SELECT NetWorthInMillions from Actors where FirstName IN(Tom, Kim);