For a class F of complex-valued functions on a set D, we define its sampling numbers g_n
as the minimal worst-case error on F, measured in L_2, that can be achieved with an optimal algorithm
based on n function evaluations. We prove that there is a universal constant c > 0 such that
the sampling numbers of the unit ball F of every separable reproducing kernel Hilbert space are bounded by
the tails of the the Kolmogorov widths (or approximation numbers) of F in L_2.
We also obtain similar upper bounds for more general classes F, including compact subsets of
the space of continuous functions on a bounded domain D.
Moreover, we provide examples where these bounds are attained up to a constant.