Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To expand on this, learn about some of the neat things you can do within a SELECT statement.

Learn how the JOIN syntax works[0], and how to use OUTER JOINs.

Learn about WINDOW[1] functions and what kind of problems they can solve. In particular, many reporting needs can probably be solved with WINDOW functions instead of tracking state as you loop through a result set in application code.

Learn about Common Table Expressions[2]. While these usually aren't necessary, they can make your queries a LOT more readable.

The thing about learning this type of stuff is that it doesn't matter what database you learn on, you can use it on virtually any SQL database (possibly requiring minor syntax changes).

[0] https://www.postgresql.org/docs/12/tutorial-join.html and https://www.postgresql.org/docs/12/queries-table-expressions...

[1] https://www.postgresql.org/docs/12/tutorial-window.html

[2] https://www.postgresql.org/docs/12/queries-with.html



WINDOW is incredible. Probably among the most useful yet least understood areas of SQL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: