Let $k$ be a field, $A$ be an integral domain, $B \subset A$, and $A, B$ are both finitely generated $k$ algebra. Let $p \subset B$ be a prime ideal. Suppose there exists prime ideals $q \subset A$, such that $q \cap B=p$, and $q$ is the minimal such ideal in the sense of inclusion.  Then, is it true $ dim A_q \leq dim B_p$ ?

For the geometric meaning, it comes from the exercise of Chapter 2, 3.22(a) of Hartshorne, where:           Let $ f: Spec(A) \to Spec(B) $ be a dominant morphism, $p \in Spec(B), Y'=$ {$ \bar{ p }$} (the closure of {$p$}) and $Z$ be an irreducible component of $f^{-1}(Y')$, whose generic point $q$ maps to $p$, then show that $ codim(Z,X) \leq codim(Y',Y)$.

I guess, everything translates faithfully to the above algebra fact except "$f$ dominant " is weakend by " $ B \to A$ is injective".