Run query to database query guild base