There is a bijection between the set of squarefree integers and the set of quadratic extensions of $\mathbb{Q}$, given by $d \mapsto \mathbb{Q}(\sqrt{d})$. Exclude $1$ from being squarefree.
Surjectivity: a quadratic extension of $\mathbb{Q}$ takes the form $\mathbb{Q}(\sqrt{D})$ for some rational number $D = \pm p_1^{e_1} \cdots p_r^{e_r}$, where $p_i$ are prime numbers and $e_i$ are integers. If $e_i$ is even, then clearly one can obtain the same extension by removing $p_i^{e_i}$ from the factorization, so we may assume all the $e_i$ are odd. Then $\mathbb{Q}(\sqrt{D}) = \mathbb{Q}(\sqrt{\pm p_1 \cdots p_r})$, keeping the same sign as $D$.
Injectivity: Let $d_1, d_2$ be squarefree integers. To say that $\mathbb{Q}(\sqrt{d_1}) = \mathbb{Q}(\sqrt{d_2})$ is to say that $\sqrt{d_1} = a + b \sqrt{d_2}$ for rational numbers $a, b$, or $d_1 = a^2 + d_2 b^2 + 2ab \sqrt{d_2}$. Since $\sqrt{d_2} \not\in \mathbb{Q}$, we must have either $a$ or $b$ equal to $0$. Thus either $d_1 = a^2$ or $d_1 = d_2 b^2$. But $d_1$ is squarefree, so $a = 0$ and $b = \pm 1$, so $d_1 = d_2$.
Thus to determine whether $\mathbb{Q}(\sqrt{D_1}) = \mathbb{Q}(\sqrt{D_2})$ for rational numbers $D_i$, one can do the following: write $D_1$ as a product of prime numbers $\pm p_1^{e_1} \cdots p_r^{e_r}$ for integers $e_i$. Let's say that $e_1, ... , e_t$ are odd integers, and $e_{t+1}, ... , e_r$ are even. Then $\mathbb{Q}(\sqrt{d_1})$, where $d_1 = \pm p_1 \cdots p_t$, keeping the same sign as before. Do the same for $D_2$, obtaining $\mathbb{Q}(\sqrt{D_2}) = \mathbb{Q}(\sqrt{d_2})$ for some squarefree integer $d_2$. By the result above, the given quadratic extensions are equal if and only if $d_1 = d_2$.