update query example

update the query example with complex queries involves two models.