We have re-evaluated empirical expressions for the abundance determination of N , O , Ne , S , Cl , Ar and Fe taking into account the latest atomic data and constructing an appropriate grid of photoionization models with state-of-the art model atmospheres . Using these expressions we have derived heavy element abundances in the \sim 310 emission-line galaxies from the Data Release 3 of the Sloan Digital Sky Survey ( SDSS ) with an observed H \beta flux F ( H \beta ) > 10 ^ { -14 } erg s ^ { -1 } cm ^ { -2 } and for which the [ O iii ] \lambda 4363 emission line was detected at least at a 2 \sigma level , allowing abundance determination by direct methods . The oxygen abundance 12 + log O/H of the SDSS galaxies lies in the range from \sim 7.1 ( Z _ { \odot } /30 ) to \sim 8.5 ( 0.7 Z _ { \odot } ) . The SDSS sample is merged with a sample of 109 blue compact dwarf ( BCD ) galaxies with high quality spectra , which contains extremely low-metallicity objects . We use the merged sample to study the abundance patterns of low-metallicity emission-line galaxies . We find that extremely metal-poor galaxies ( 12 + log O/H < 7.6 , i.e . Z < Z _ { \odot } /12 ) are rare in the SDSS sample . The \alpha element-to-oxygen abundance ratios do not show any significant trends with oxygen abundance , in agreement with previous studies , except for a slight increase of Ne/O with increasing metallicity , which we interpret as due to a moderate depletion of O onto grains in the most metal-rich galaxies . The Fe/O abundance ratio is smaller than the solar value , by up to 1 dex at the high metallicity end . We also find that Fe/O increases with decreasing H \beta equivalent width EW ( H \beta ) . We interpret this as a sign of strong depletion onto dust grains , and gradual destruction of those grains on a time scale of a few Myr . All the galaxies are found to have log N/O > –1.6 , implying that they have a different nature than the subsample of high-redshift damped Ly \alpha systems with log N/O of \sim –2.3 and that their ages are larger than 100 – 300 Myr . We confirm the apparent increase in N/O with decreasing EW ( H \beta ) , already shown in previous studies , and explain it as the signature of gradual nitrogen ejection by massive stars from the most recent starburst .