TITLE: Finite abelian groups as class groups
QUESTION [20 upvotes]: Is it known whether every finite abelian group is isomorphic to the ideal class group of the ring of integers in some number field? If so, is it still true if we consider only imaginary quadratic fields?

REPLY [17 votes]: The smallest abelian group which is not the class group of an imaginary quadratic field is $(\mathbf{Z}/3 \mathbf{Z})^3$. There are six other groups of order
$< 100$ which do not occur in this way, of orders
$32$, $27$, $64$, $64$, $81$, and $81$ respectively.
The groups $(\mathbf{Z}/3 \mathbf{Z})^2$ and $(\mathbf{Z}/2 \mathbf{Z})^4$ occur as class groups of imaginary quadratic fields exactly once, for $D = -4027$ and $-5460$ respectively. 
These results follow from the "class number $100$" problem, solved by Mark Watkins.
If you restrict to the $p$-part of the class group, then the answer (for general number fields) is positive. That is, for any abelian $p$-group $A$, there exists a number field $K$ with class group $C$ such that $C \otimes \mathbf{Z}_p = A$.
There is even a non-abelian analog of this. Namely, for any finite $p$-group $G$, there exists a number field $K$ such that the maximal Galois $p$-extension $L/K$ unramified everywhere has Galois group $G$. This is a very recent result of Ozaki.