Dear student,
The ions presents in the above given compounds are :
Magnisium : Mg+2 , Calcium : Ca+2 ; Potassium : K+
Sulphate : SO42- Hydroxide : OH-
The acids and bases from which these salts are prepared are as follows :
(i) Mg(OH)2 + H2SO4
(ii) Ca(OH)2 is not a salt while it is a base
(iii) KOH + H2SO4
Regards