SQL: Difference between revisions
(Created page with "SQL basics ==Common functions== See [https://www.postgresql.org/docs/16/functions-math.html Postgres math functions] and [https://www.postgresql.org/docs/current/functions-conditional.html Postgres conditional functions]. * Average * Sum * Round * [https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-COALESCE-NVL-IFNULL Coalesce] - return the first non-null parameter. * [https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIO...") |
(No difference)
|
Revision as of 01:42, 12 February 2024
SQL basics
Common functions
See Postgres math functions and Postgres conditional functions.
Joins
Joins merge two tables into a single table. You can think of this like an outer product, applying some conditions to subset from every possible combination of rows from the two tables.
- Inner join - creates rows only if keys match between the rows
- Left join - keep all rows from the left table
- Right join - keep all rows from the right table
- Outer join - keep rows from both tables.