  Extremal problems concerning the number of complete subgraphs have a long
story in extremal graph theory. Let $k_s(G)$ be the number of $s$-cliques in a
graph $G$ and $m={{r_m}\choose s}+t_m$, where $0\le t_m\leq r_m$. Edr\H{o}s
showed that $k_s(G)\le {{r_m}\choose s}+{{t_m}\choose{s-1}}$ over all graphs of
size $m$ and order $n\geq r_m+1$. %Clearly, $K_{r_m}^{t_m}\cup (n-r_m-1)K_1$ is
an extremal graph, where $K_{r_m}^{t_m}$ is the graph by joining a new vertex
to $t_m$ vertices of $K_{r_m}$. It is natural to consider an improvement in
connected situation: what is the maximum number of $s$-cliques over all
connected graphs of size $m$ and order $n$? In this paper, the sharp upper
bound of $k_s(G)$ is obtained and extremal graphs are completely characterized.
The technique and the bound are different from those in general case. As an
application, this result can be used to solve a question on spectral moment.
