Check the post 2,3 on my tutorial where I give an example related to the SQL query.