Aims. To assess the possible systematic differences among different oxygen abundance indicators and understand the origin of nitrogen and the stars responsible for nitrogen production, we present two samples of H ii galaxies from the Sloan Digital Sky Survey (SDSS) spectroscopic observations, data release 3.Methods. The electron temperatures (T e ) of 225 galaxies are calculated with the photoionized H ii model and T e of 3997 galaxies are calculated with an empirical method. The oxygen abundances from the T e methods of the two samples are determined reliably. The oxygen abundances from a strong line metallicity indicator, such as R 23 , P, N2, and O3N2, are also calculated. We compared oxygen abundances of H ii galaxies obtained with the T e method, R 23 method, P method , N2 method, and O3N2 method.Results. The oxygen abundances derived with the T e method are systematically lower by ∼0.2 dex than those derived with the R 23 method, consistent with previous studies based on H ii region samples. No clear offset for oxygen abundance was found between T e metallicity and P, N2 and O3N2 metallicity. When we studied the relation between N/O and O/H, we found that in the metallicity regime of 12 + log(O/H) > 7.95, the large scatter of the relation can be explained by the contribution of small mass stars to the production of nitrogen. In the high metallicity regime, 12 + log(O/H) > 8.2, nitrogen is primarily a secondary element produced by stars of all masses.