Spinal nerve is a mixed nerve (contains motor and sensory fibers).
It is formed by joining the dorsal and ventral roots which come out of the spinal cord. After coming out of spinal cord these roots merge to form spinal nerve.
The spinal nerve emerges from the spinal column through an opening (intervertebral foramen) between adjacent vertebrae. This is true for all spinal nerves except for the first spinal nerve, which emerges between the occipital bone and the atlas.