Hacker News new | ask | show | jobs
by combatentropy 3007 days ago
Like any language it takes a mixture of reading and practice. If you just read, it won't stick, because you have nothing to hang it onto. If you just practice, you'll adopt hacks that work but aren't the best way to do it. So it would be nice if you had a job that demands you regularly come up with new SQL. Try to prepare your data as much as possible in the database, instead of partly in the database and partly in your middle language (say, Python). So, for example, try to make web pages that use the Mustache template system (a very strict and minimal one) and use Python (or whatever) only to pull the data from the database and stuff it into the template. That will make you learn the esoteric features of your database.

I agree with others that you should try to use Postgres. It's easy to get going on Linux, but if for whatever reason you can't right now, SQLite is good, too. Really, Postgres or SQLite, there is no technical need for any other database.

Supposing that you can go with Postgres, then your reading assignment is easy: just read the Postgres documentation from start to finish. Of course you won't get it the first time, and it might be a multimonth affair, but it's about as good as any book I've found. For some reason, all books on SQL are really boring. My very first book was Databases Demystified, which was a fine book and helped me learn "normalization," which is a fancy word for Don't Repeat Yourself --- except it's talking about reducing redundancy in data instead of code.