now, a square pyramid is called that, because its base is a square.
if one side on its base has a length of 3, then all sides are 3 units long, since is a squarish base, and therefore the area of the base is 3x3 or 9 ft².
[tex]\bf \textit{volume of a pyramid}\\\\
V=\cfrac{1}{3}Bh\quad
\begin{cases}
B=base's~area\\
h=height\\
--------\\
V=12\\
B=\stackrel{3\times 3}{9}
\end{cases}\implies 12=\cfrac{1}{3}9h\implies 12=3h
\\\\\\
\cfrac{12}{3}=h\implies 4=h[/tex]