> For the complete documentation index, see [llms.txt](https://edward-stevinson.gitbook.io/tech-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edward-stevinson.gitbook.io/tech-notes/computer-science/sql.md).

# SQL

## General SQL

* `COALESCE`: Return the first non-null value in a list
* `LAG`:

## POSTGRES

`\l`: list all databases

`\c <database_name>`: use that database to execute psql commands

`\dt`: list tables when in above mode
