Context : Among the spectroscopically identified white dwarfs , a fraction smaller than 2 % have spectra dominated by carbon lines , mainly molecular C _ { 2 } , but also in a smaller group by C i and C ii lines . These are together called DQ white dwarfs . Aims : We want to derive atmospheric parameters T _ { eff } , \log g , and carbon abundances for a large sample of these stars and discuss implications for their spectral evolution . Methods : Sloan Digital Sky Survey spectra and ugriz photometry were used , together with Gaia Data Release 2 parallaxes and G band photometry . These were fitted to synthetic spectra and theoretical photometry derived from model atmospheres . Results : We found that the DQs hotter than T _ { eff } \approx 10000 K have masses \approx 0.4 M _ { \odot } larger than the classical DQ , which have masses typical for the majority of white dwarfs ( \approx 0.6 M _ { \odot } ) . We found some evidence that the peculiar DQ below 10000 K also have significantly larger masses and may thus be the descendants of the hot and warm DQs above 10000 K. A significant fraction of the hotter objects with T _ { eff } > 14500 K have atmospheres dominated by carbon . Conclusions :