The generalization of summation-by-parts operators for the first derivative of Del Rey Fernandez, Boom, and Zingg [J. Comput. Phys., 266 (2014), pp. 214-239] is extended to approximations of second derivatives with a constant or variable coefficient. This enables the construction of second-derivative operators with one or more of the following characteristics: (i) nonrepeating interior point operators, (ii) nonuniform nodal distributions, and (iii) exclusion of one or both boundary nodes. Definitions are proposed that give rise to generalized summation-by-parts operators that result in consistent, conservative, and stable discretizations of partial differential equations with or without mixed derivatives. It is proven that approximations to the second derivative with a variable coefficient can be constructed using the constituent matrices of the constant-coefficient operator. Moreover, for operators with a repeating interior point operator, a decomposition is proposed that makes the application of such operators particularly straightforward. A number of novel operators are constructed, including operators on the Chebyshev-Gauss quadrature nodes and operators that have a repeating interior point operator but nonuniform nodal spacing near boundaries. The various operators are compared to the application of the first-derivative operator twice in the context of the linear convection-diffusion equation with a variable coefficient.