  The paper studies the cohomology of Lie algebras and quadratic Lie algebras.
Firstly, we propose to describe the cohomology of $MD(n,1)$-class which was
introduced in \cite{LHNCN16}. This class contains Heisenberg Lie algebras. In
1983, L. J. Santharoubane \cite{San83} computed the cohomology of Heisenberg
Lie algebras. In this paper, we will completely describe the cohomology of the
other ones of $MD(n, 1)$-class. Finally, we will be concerned about the
cohomology of quadratic Lie algebras. In 1985, A. Medina and P. Revoy
\cite{MR85} computed the second Betti number of the generalized real diamond
Lie algebras. We will compute in this paper the second Betti number of the
generalized complex diamond Lie algebras by using the super-Poisson bracket.
