Definition of degree of finite morphism plus context Let $f: X \rightarrow Y$ be a finite morphism of schemes, defined here,
http://en.wikipedia.org/wiki/Finite_morphism
I always assumed that the degree of $f$ was the degree of the induced field extension
$$
[K(Y):K(X)],
$$
of course only defined if $f$ is dominant (hence surjective).
However, is this standard?
Or is the degree of $f$ defined as: Let $f$ locally be given by maps of rings $B_i \rightarrow A_i$. The degree of $f$ is the minimal number of elements of $A_i$ that generate it as a $B_i$ module?
I'm almost sure this does not work.
Q1: Why not? (excuse my lack of commutative algebra knowledge) (i am more than happy with just a sketchy answer to this!)
Q2: Does it work if we assume $X$ and $Y$ to be varieties over $\mathbb{C}$? If so/not, why?
Q3: What is indeed the commonly agreed definition of the degree of a finite map?
That's quite a lot, thanks for your answer!
 A: I just want to note that you don't need any finiteness condition on $f$ to define the degree.  Any dominant morphism $f : X \to Y$ of integral schemes $X$ and $Y$ maps the generic point $x$ of $X$ to the generic point $y$ of $Y$, hence there is a canonical homomorphism $\mathscr{O}_{Y,y} \to \mathscr{O}_{X,x}$, which gives a field extension $R(Y) \hookrightarrow R(X)$.  (Thanks for Georges Elencwajg for simplifying my original argument.)
So we don't need finiteness conditions on $f$, or on $X$ and $Y$, to talk about the field extension $R(Y) \hookrightarrow R(X)$ or its degree $\deg(f) =  [R(X) : R(Y)]$.  However if one wants to ensure this degree is finite, it suffices to assume $f$ is locally of finite type and
(i) $f$ is closed, the dimensions of $X$ and $Y$ are equal (see (Stacks, 02JX) and (Stacks, 02NX)),
or
(ii) $f$ is separated or quasi-compact (e.g. proper or even just universally closed), and there exists an affine open $V \subset Y$ such that the restriction $f^{-1}(V) \to V$ is finite (Stacks, 02NX).
A: Besides Adeel's nice answer, one can find another definition of the degree in case the morphism is flat and finite (and the schemes are locally Noetherian) in the Stacks project 02K9. This is actually the thing I hoped it would be, as I stated in the question.
A: If you want to talk of function fields, it is prudent to consider only finite dominant morphisms $f\colon X\to Y$ between (locally noetherian) integral schemes.
The degree of $f$ is then defined as the degree of the corresponding extension of function fields $n=[k(X):k(Y)]$.
Qing Liu in his wonderful book  asks you to prove (Chapter5, Exercise 1.25) that if $f$ is flat, then all fibers $f^{-1}(y)$ of $f$ have $n$ points, if you count them suitably: $\dim_{k(y)}\mathcal O(f^{-1}(y))=n$ .  
Warning: The result is always false if $f$ is not flat!
This is part of the exercise mentioned above.
For example if you normalize the node $N=V(y^2-x^2-x^3)\subset \mathbb A^2_k$, you obtain the finite morphism $$f\colon \mathbb A^1_k\to N\colon t\mapsto (t^2-1,t^3-t)$$ of degree $$[k(\mathbb A^1_k):k(N)]=[k(t):k(t^2-1,t^3-t)]=[k(t):k(t)]=1$$
However for the fiber over $P=(0,0)\in N$ you have $\dim_{k(P)}\mathcal O(f^{-1}(P))=2$ because $f^{-1}(P)$ consists of the two simple points $t=-1, t=+1$.
