  In an edge-colored graph $G$, a rainbow clique $K_k$ is a $k$-complete
subgraph in which all the edges have distinct colors. Let $e(G)$ and $c(G)$ be
the number of edges and colors in $G$, respectively. In this paper, we show
that for any $\varepsilon>0$, if $e(G)+c(G) \geq
(1+\frac{k-3}{k-2}+2\varepsilon) {n\choose 2}$ and $k\geq 3$, then for
sufficiently large $n$, the number of rainbow cliques $K_k$ in $G$ is
$\Omega(n^k)$.
  We also characterize the extremal graphs $G$ without a rainbow clique $K_k$,
for $k=4,5$, when $e(G)+c(G)$ is maximum.
  Our results not only address existing questions but also complete the
findings of Ehard and Mohr (Ehard and Mohr, Rainbow triangles and cliques in
edge-colored graphs. {\it European Journal of Combinatorics, 84:103037,2020}).
