database query user interface