  We study a known filtration of the second cohomology of a finite dimensional
nilpotent Lie algebra $\mathfrak{g}$ with coefficients in a finite dimensional
nilpotent $\mathfrak{g}$-module $M$, that is based upon a refinement of the
correspondence between $\mathrm{H}^2(\mathfrak{g},M)$ and equivalence classes
of abelian extensions of $\mathfrak{g}$ by $M$. We give a different
characterization of this filtration and as a corollary, we obtain an expression
for the second Betti number of $\mathfrak{g}$. Using this expression, we find
bounds for the second Betti number and derive a cohomological criterium for the
existence of certain central extensions of $\mathfrak{g}$.
