1. Oxidation number is the number that represents degree on oxidation i.e., the number of electrons lost by an element.
2. This phenomenon has nothing to do with covalent,ionic or any other type of bonding as it depends on the nature of elements because of their electronegativity values.
3. For e.g take Cl atom in HCl and HClO molecules. Now when we calculate the oxidation numbers for Cl we see that:
(a) In HCl it is -1. This is because, Cl is highly electronegative in comparison to H, thus pulls one electron of H towards itself and effectively has 8 electrons.
(b) In HClO, which is covalent compound, Cl has oxidation number +1. This is because O is much more electronegative than Cl, so it pulls the electron of both H and Cl, and they both have oxidation states. +1.