Valency in terms of chlorine:
The chlorine's valency is one. The number of chlorine atoms with which one atom of an element can join is called its valency.
In a sodium chloride (NaCl) molecule, one chlorine atom joins with one sodium atom. So, the valency of sodium is one.
In magnesium chloride (\(MgCl_2\)), the valency of magnesium is two because it combines with two chlorine atoms.
Valency in terms of oxygen:
Another way of valency can be described as double the number of oxygen atoms with which one atom of an element can join because the valency of oxygen is two.
In magnesium oxide (MgO), the valency of magnesium is two.