  X-ray emission is an important indicator of stellar activity. In this paper,
we study stellar X-ray activity using the XMM-Newton and LAMOST data for
different types of stars. We provide a sample including 1259 X-ray emitting
stars, of which 1090 have accurate stellar parameter estimations. Our sample
size is much larger than those in previous works. We find a bimodal
distribution of X-ray to optical flux ratio (log(fX/fV)) for G and K stars. We
interpret that this bimodality is due to two subpopulations with different
coronal heating rates. Furthermore, using the full widths at half maxima
calculated from H{\alpha} and H\b{eta} lines, we show that these stars in the
inactive peaks have smaller rotational velocities. This is consistent with the
magnetic dynamo theory that stars with low rotational velocities have low
levels of stellar activity. We also examine the correlation between log(fX/fV)
and luminosity of the excess emission in the H{\alpha} line, and find a tight
relation between the coronal and chromospheric activity indicators.
