Creating summary spectra in a database with levels