The herniation of the nucleus pulposus is most commonly in the posterolateral direction as it is the weakest part of the surrounding annulus fibrosus.
So each inter vertebral disk (nucleus pulposus) will press on the corresponding spinal nerve causing specific anatomic (dermatomic distribution of the affected areas)
The question is what disc number corresponds to what spinal nerve number?
All the spinal nerves are named by the vertebra above it, so for example inter vertebral disc T11-T12 will press on the T11 nerve as it exits in the inter vertebral foramen right below T11 vertebra
There's an exception to this rule..
Because we have more cervical spinal roots (eight) than we have vertebra (seven), then the first seven spinal roots exit above the corresponding numbered vertebra.
So a C4-C5 disk herniation will press on C5 nerve.
Click on this thumbnail to view
Copyright notice: this image was modified from this image posted in Wikimedia Commons
It's also important not confuse the roots (ventral and dorsal contained within the meninges, see image) with the rami (ventral and dorsal, the dorsal ramus is usually not drawn in such an image because it sprouts immediately and loops back to the posterior body supplying the muscles of the back and zygahypophyseal joints)