Mining the SDSS archive. I. Photometric redshift in the nearby universe