Let $f(x)$ be a polynomial of degree $n$ with coefficients in $\mathbb{Q}$. There are well-known ways to construct a $n \times n$ matrix $A$ with entries in $\mathbb{Q}$ whose characteristic polynomial is $f$. My question is: when is it possible to choose $A$ symmetric?

An obvious necessary condition is that the roots of $f$ are all real, but it is not clear to me even in the case $n = 2$ that this is sufficient. In degree $2$ this comes down to determining whether or not every pair $(p,q)$ which satisfies $p^2 > 4q$ (the condition that $x^2 + px + q$ has real roots) can be expressed in the form $$p = -(a + c)$$ $$q = ac - b^2$$ where $a$, $b$, and $c$ are rational. I have some partial results from just fumbling around and checking cases, but it seems clear that a more conceptual argument would be required to handle larger degrees.