  A number field $k$ admits a binary integral quadratic form which represents
all integers locally but not globally if and only if the class number of $k$ is
bigger than one. In this case, there are only finitely many classes of such
binary integral quadratic forms over $k$. A number field $k$ admits a ternary
integral quadratic form which represents all integers locally but not globally
if and only if the class number of $k$ is even. In this case, there are
infinitely many classes of such ternary integral quadratic forms over $k$. An
integral quadratic form over a number field $k$ with more than one variables
represents all integers of $k$ over the ring of integers of a finite extension
of $k$ if and only if this quadratic form represents $1$ over the ring of
integers of a finite extension of $k$.
