w3schools and the online documentation for any database are good places to start (Postgres and SQL Server have pretty good documentation).
There are also easy-to-google SQL Puzzles, if you're looking for something more advanced.
I would also recommend learning about query plans and how to read them, they're invaluable for query optimization.