select g.teff_gspphot, g.distance_gspphot, g.phot_g_mean_mag from gaiadr3.gaia_source_lite as g where (g.parallax_over_error > 50) and (g.teff_gspphot > 100) and (g.distance_gspphot > 1) and (g.phot_g_mean_mag < 18) and (g.random_index < 200000) ;