Chemical study regarding total π-electron energy with respect to conjugated molecules has focused on the second Zagreb index of graphs. Moreover, in the last half-century, it has gotten a lot of attention. The relationship between the Roman domination number and the second Zagreb index is investigated in this study. We characterize the trees with the maximum second Zagreb index among those with the given Roman domination number.