  A quadratic semigroup algebra is an algebra over a field given by the
generators $x_1,...,x_n$ and a finite set of quadratic relations each of which
either has the shape $x_jx_k=0$ or the shape $x_jx_k=x_lx_m$. We prove that a
quadratic semigroup algebra given by $n$ generators and $d\leq \frac{n^2+n}{4}$
relations is always infinite dimensional. This strengthens the
Golod--Shafarevich estimate for the above class of algebras. Our main result
however is that for every $n$, there is a finite dimensional quadratic
semigroup algebra with $n$ generators and $\delta_n$ relations, where
$\delta_n$ is the first integer greater than $\frac{n^2+n}{4}$. This shows that
the above Golod-Shafarevich type estimate for semigroup algebras is sharp.
