db query interface define