Working on db queries.