Also, there are some (legitimately) free SQL books that might be worth a look:
https://www.linuxlinks.com/excellent-free-books-learn-sql/
Then there's this freebie, which is interesting in that it's compiled from StackOverflow, whose content is licensed under Creative-Commons -- GoalKicker has a bunch of these on various tech topics. Anyway, the SQL one might have some useful tips/tricks:
https://books.goalkicker.com/SQLBook/SQLNotesForProfessional...
(It has gotten good ratings and reviews:
https://www.goodreads.com/book/show/40730648-sql-notes-for-p... )
They also have such books on specific databases: MySQL, Postgres, SQLServer and Oracle -- see all their books on their main page:
And, once you learn SQL, you might want to check out webpages (and YouTube videos) of SQL tips/tricks to pick up useful tidbits: