they're both AA, jairo. that's what a SAM is used for. it stands for "surface-to-air missile"
as far as I can tell, he's asking whether an AA gun or AA missiles are more effective, and it depends on a lot of things
with missiles you can forget about the target after you fire them, and fire at another, but the plane might be able to outmaneuver or even outrun the missiles, or it might have countermeasures like flares or chaff
with a gun, you have to keep focused on the one target until you kill it, but things like chaff won't have any effect on the weapon