Second-harmonic generation as a tool for studying electronic and magnetic structures of crystals: review