I have come across a graph-theoretic problem where it would be nice to bound the "sum of squared degrees", in the following sense. We have a graph $G$ with vertex set $[n]$ and let $d(G) = \sum_{i=1}^n \deg(i)^2$.
Has this parameter been studied before, perhaps in some special cases? I would appreciate any pointers to the literature, especially for cases in which the order of $d(G)$ is significantly less than $n^3$. In particular, is this true when $G$ is tripartite and the edge set of $G$ is a union of disjoint triangles?