Answer: The correct answer is Option B.
Step-by-step explanation:
Compound having oppositely charged ions are considered as ionic compounds.
Ionic compounds are formed when complete transfer of electrons takes place between the atoms forming a bond. This bond is formed between a metal and a non-metal or a polyatomic cation and an non-metal or a metal and a polyatomic anion. For Example:
etc..
Covalent compounds are formed when sharing of electrons takes place between the atoms forming a bond. This bond is formed between two non-metals. For Example:
etc..
For the given options:
Option A:

Oxygen and chlorine both are non-metals. Thus, it is forming a covalent compound.
Option B:

Sodium is a metal and oxygen is a non-metal. Thus, it is forming an ionic compound and contain oppositely charged ions.
Option C:

Nitrogen and hydrogen both are non-metals. Thus, it is forming a covalent compound.
Option D:

Sulfur and chlorine both are non-metals. Thus, it is forming a covalent compound.
Hence, the correct answer is Option B.