database name query improved