I'm having troubles understanding the definition of an order of an algebraic number field. The formal definition should be:
Let $K$ be a number field. An order $O$ of $K$ is a subring of $K$ that is finitely generated as a $\mathbb{Z}-$module and satisfies $O\otimes \mathbb{Q}=K.$
I understand what it means that $O$ is finitely generated as a $\mathbb{Z}-$module, but the second condition is not very intuitive. Can someone help me with that?
The point is that an order in a number field $K$ is supposed to be a "big" subring of $\mathcal O_K$ (the integers of $K$), and being "big" can be described in several equivalent ways (the equivalence is not always obvious):
having the same rank $[K:\mathbf Q]$ as a $\mathbf Z$-module that $\mathcal O_K$ has,
having finite index in $\mathcal O_K$,
containing a basis of $K/\mathbf Q$.
Maybe it's worth seeing some rings that are not orders. In $\mathbf Q(i)$, $\mathbf Z[i]$ is the full ring of integers (the maximal order in $\mathbf Q(i)$) and its subring $\mathbf Z[2i] = \mathbf Z + \mathbf Z(2i)$ has rank $2$ and is an order, while $\mathbf Z$ is not an order in $\mathbf Q(i)$: it's too small because its fraction field is $\mathbf Q$ rather than $\mathbf Q(i)$.
In $\mathbf Q(\sqrt{2},\sqrt{3})$, which has degree $4$ over $\mathbf Q$, the ring $\mathbf Z[\sqrt{2}]$ is not an order since its $\mathbf Z$-rank is $2$ rather than $4$ (and its fraction field $\mathbf Q(\sqrt{2})$ is too small).