I got from two different books a set $\displaystyle B= \{r \in \mathbb{Q}: 0 \leq r \leq \sqrt{2}\}$.

One book says $\displaystyle B$ does not have $\displaystyle sup (B)$ and $\displaystyle \sqrt{2}\not = sup(B)$ because $\displaystyle \sqrt{2} \not \in B$.

The other book says $\displaystyle sup(B) = \sqrt{2}$. Although$\displaystyle \sqrt{2}\not \in B$, there are rationals in the set arbitrarily close to $\displaystyle \sqrt{2}$.

Who is right?

The first book is a textbook, and the second is a supplement.