chapter 1 querying and sql functions