why sodium has valency 1 and chlorine also 1?
Sodium has atomic mass 23, atomic number 11.
Chlorine has atomic mass 35 ,atomic number 17.
When we write electronic configuration
for Sodium Na - 2,8,1
Chlorine Cl - 2,8,7
Both Na and Cl require 1 electron either to loose or to gain ,so they can attain stable configuration.
Therefore Na has +1 and Cl -1 valency