Sum rules and giant resonances in nuclei