Completed the example, querying the DB