I need to learn SQL for work, and my employer will pay for books but not courses. What would be a good book to start with, preferably one that gets me writing queries?
What SQL books are good for learning on the job?
Answers
Learning SQL is a solid starting point. It moves through SELECT, joins, subqueries and other fundamentals in a sensible order, with examples and chapter exercises.
Run the queries as you read instead of just looking at them. PostgreSQL or SQLite with a sample dataset such as Chinook or Northwind would give you somewhere to experiment.
Reply to this answer
Take a look at SQL Queries for Mere Mortals. It sounds like a good fit if you want a structured book focused on actually writing queries rather than sitting through a lot of conceptual material first.
Reply to this answer
Find out which database your workplace uses before choosing. SQL dialects differ, so a book aimed at the database you use can make the examples more directly useful.
For SQL Server, consider T-SQL Fundamentals. For PostgreSQL, Practical SQL is an introductory option. The Art of PostgreSQL is another choice once you are comfortable with joins and window functions.
Reply to this answer
For a second book after the basics, consider SQL Antipatterns. It focuses on mistakes and troublesome patterns that can come up in database work, so it may be more useful once you have written a few queries.
Reply to this answer
SQL Cookbook is worth considering after an introductory book. Syntax is one thing, but figuring out how to put a query together to solve a particular problem takes practice too.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Daisy Chain:
Free interactive SQL puzzles can supplement a book if you want extra practice without asking work to fund a course.