Dimension of $\mathbb{Q}\otimes_{\mathbb{Z}} \mathbb{Q}$ as a vector space over $\mathbb{Q}$ The following problem was subject of examination that was taken place in June. The document is here. Problem 1 states:

The tensor product $\mathbb{Q}\otimes_{\mathbb Z}\mathbb{Q}$ is a vector space
  over $\mathbb{Q}$ by multiplication in the left factor, i.e.
  $\lambda(x\otimes y)=(\lambda x)\otimes y$ for $\lambda, x,
 y\in\mathbb{Q}$. What is the dimension of
  $\mathbb{Q}\otimes_{\mathbb{Z}}\mathbb{Q}$ as a vector space over
  $\mathbb{Q}$?

I only know the definition of tensor product for modules (via universal property). How does one go about calculating dimension of such a vector space? 
Thanks!
 A: Begin by checking 
\begin{align}\frac{a}{b}\otimes \frac{c}{d}&=\frac{ad}{bd}\otimes\frac{c}{d}\\
&=\frac{a}{bd}\otimes\frac{cd}{d}\\
&=\frac{a}{bd}\otimes c\\
&=\frac{ac}{bd}\otimes 1
\end{align}
So, $\mathbb{Q}\otimes_{\mathbb{Z}}\mathbb{Q}=\mathbb{Q}$.
Now you can end it.
A: I just want to make remark that RGB's answer more generally shows the following. Suppose $M,N$ are $S^{-1}A$ - modules. Then we can form both $M \otimes_{S^{-1}A} N$ and $M \otimes N$. The former is an $S^{-1}A$ - module and the latter an $A$ - module by restriction of scalars. The ultimate point now is this:
$M \otimes_A N$ already has the structure of an $S^{-1}A$ - module built into it! Thus $M \otimes_{S^{-1}A} N$ and $M \otimes_A N$ are canonically isomorphic as $S^{-1}A$ modules; this is basically the content of RGB's answer.
If you want to show $\Bbb{Q} \otimes_{\Bbb{Z}} \Bbb{Q} \cong \Bbb{Q}$ using universal properties here is what we do: Let $f : \Bbb{Q} \times \Bbb{Q} \to M$ be a $\Bbb{Z}$ - bilinear map. Consider $\pi : \Bbb{Q} \times \Bbb{Q} \to \Bbb{Q}$ that sends $(a,b)$ to $ab$. Now we have linearity in the first variable because  $$\begin{eqnarray*} \pi(na_1 + ma_2,b) &=& (na_1+ma_2)b \\
 &=& n(a_1b) + m(a_2b) \\
&=& n\pi(a_1,b) + m\pi(a_2,b)\end{eqnarray*}$$
for any $a_1,a_2,b \in \Bbb{Q}$ and $n,m\in \Bbb{Z}$. By symmetry linearity in the second variable follows and so $\pi$ is bilinear. Let us now define a map $g : \Bbb{Q} \to M$  by $g(a) = f(a,1)$ for any $a \in \Bbb{Q}$. This map $g$ is linear because $f$ is linear in the first variable. Also $g$ is well - defined and furthermore is unique: Any linear map out of $\Bbb{Q}$ to $M$ $\tilde{g}$ such that $\tilde{g} \circ \pi = f$ must necessarily satisfy $$ \tilde{g}(a) = \tilde{g}(\pi(a,1)) = f(a,1).$$
Thus we have shown that $\Bbb{Q}$ satisfies the universal property of $\Bbb{Q} \otimes_{\Bbb{Z}} \Bbb{Q}$ and so the answer to your question comes easily: $\dim_\Bbb{Q} \Bbb{Q} \otimes_{\Bbb{Z}} \Bbb{Q} = 1$.
A: There is another solution using category theory : tensor product is the fiber coproduct in the category of commutative rings. $\mathbb{Z} \rightarrow \mathbb{Q}$ is an epimorphism since it's a localization.
If $A \rightarrow B$ is an epimorphism, and $B \rightarrow C, B \rightarrow D$ are any morphisms, then $C \coprod_A D \simeq C \coprod_B D$. Therefore, $\mathbb{Q} \otimes_{\mathbb{Z}} \mathbb{Q} = \mathbb{Q} \otimes_{\mathbb{Q}} \mathbb{Q}= \mathbb{Q}$
