Let $ax^2 + bxy + cy^2$ be a binary quadratic form over $\mathbb{Z}$. Let $D = b^2 - 4ac$ be its discriminant. It is easy to see that $D \equiv 0$ (mod $4$) or $D \equiv 1$ (mod $4$).
Conversely suppose $D$ is a non-square integer such that $D \equiv 0$ (mod $4$) or $D \equiv 1$ (mod $4$). Then there exists the principal form of discriminant $D$(see this question).
Let $K$ be an algebraic number field of degree $n$. An order of $K$ is a subring $R$ of $K$ such that $R$ is a free $\mathbb{Z}$-module of rank $n$. Let $\alpha_1, \cdots, \alpha_n$ be a basis of $R$ as a $\mathbb{Z}$-module. Let $d = det(Tr_{K/\mathbb{Q}}(\alpha_i\alpha_j))$. It is easy to see that $d$ is independent of a choice of a basis of $R$. We call $d$ the discriminant of $R$.
Is the following proposition true? If yes, how do we prove it?
Proposition Let $D$ be a non-square integer such that $D \equiv 0$ (mod $4$) or $D \equiv 1$ (mod $4$). Then there exists an order $R$ of a quadratic number field $K$ such that the discriminant of $R$ is $D$. $K$ and $R$ are uniquely determined by $D$.
Conversely let $R$ be an order of a quadratic number field $K$. Let $D$ be the discriminant of $R$. Then $D$ is a non-square integer such that $D \equiv 0$ (mod $4$) or $D \equiv 1$ (mod $4$).