Update queries about DB navigation.

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>