In the book Hands-on node, the author gives an example of blocking I\\O,
var post = db.query(\"select * from posts where id = 1\");
doSomethingWithPost(post)
Ryan Dahl's intro is a pretty good overview, but this beginner's tutorial is excellent, it explains in detail and in a friendly way the premise of non/blocking operations in Javascript (and so Node).
But in a nutshell, the callback parameter in the 2nd example you've posted isn't executed until db.query finishes, it is "held on to for later", which means code after the db.query() call can continue to be executed.