Every time I work with SQL I'm awestruck. It feels like I'm standing on the shoulder of super smart giants. And as modern programmers we have access to amazing SQL databases, for free. All you need to fully take advantage of this, is to learn SQL.
I work with databases almost every day, yet ORMs, open source libraries and other tools mostly take away the requirement of writing SQL. I felt rusty and knew there were some great features I'm missing out on. Especially since I'm starting to write more code in Go these days, where it's not strange to write SQL queries by hand, I thought I ought to up my game.
A few years ago I visited a site called pgexercises.com, and it seemed helpful (and challenging). It offers interactive challenges that involve writing SQL queries against a Postgres database. Back then I never actually did the exercises. This weekend I did, and I highly recommend it.
So if you want to up your knowledge, or just remind yourself how to write recursive queries and window functions, go over to pgexercises.com.
PS. If you're interested in how SQL databases are made, see this video by the creator of SQLite.