Context. With now more than 20 exoplanets discovered by CoRoT, it has often been considered strange that so many of them are orbiting F-stars, and so few of them K-or M-stars. Up to now, studies of the relation between the frequency of extrasolar planets and the spectral types, or masses of their host stars has been the realm of radial velocity surveys. Although transit search programs are mostly sensitive to short-period planets, they are ideal for verifying these results. This is because transit search programs have different selection biases than radial velocity surveys. To determine the frequency of planets as a function of stellar mass, we also have to characterize the sample of stars that was observed. Aims. We study the stellar content of the CoRoT-fields IRa01, LRa01 (=LRa06), and LRa02 by determining the spectral types of 11 466 stars. Nine planet-host stars have already been identified in these fields. Determing the spectral types of thousands of stars of which CoRoT obtained high-precision light-curves also makes a wide variety of other research projects possible. Methods. We used spectra obtained with the multi-object spectrograph AAOmega and derived the spectral types by using template spectra with well-known parameters. Results. We find that 34.8 ± 0.7% of the stars observed by CoRoT in these fields are F-dwarfs, 15.1 ± 0.5% G-dwarfs, and 5.0 ± 0.3% K-dwarfs. We conclude that the apparent lack of exoplanets of K-and M-stars is explained by the relatively small number of these stars in the observed sample. We also show that the apparently large number of planets orbiting F-stars is similarly explained by the large number of such stars in these fields. Given the number of F-stars, we would have expected to find even more F-stars with planets. Our study also shows that the difference between the sample of stars that CoRoT observes and a sample of randomly selected stars is relatively small, and that the yield of CoRoT specifically is the detection one hot Jupiter amongst 2100 ± 700 stars. Conclusions. We conclude that transit search programs can be used to study the relation between the frequency of planets and the mass of the host stars, and that the results obtained so far generally agree with those of radial velocity programs.