An exercise that hits all three parts of the deltoid is the shoulder press. When you do the exercise you pick up a pair of dumbbells and hold them level to the shoulder in either a seated position or standing. You raise the dumbbells up over your head and then back down. 8-10 reps is a good amount for building the muscle. If your goal is to get defined deltoids (like basketball players, footbal players have) increase the reps to 12-15. Do 3-5 sets.
For the front deltoid exercises such as front raises with dumbells are good. For the rear deltoid you can do bent over lateral raises. You preform these by doing the following: using dumbbells, bend over at the waist with your feet shoulder width apart. Bend the knees slightly so that you don't stain yourlower back. Hold the dumbbells at arms length in front of you with the palms of your hands facing each other. Keep a slight bend in your elbows and bring the bumbells back towards your ears and then back down. The rear deltoid is usually not that strong so start off with light weights.
Below is a good video I found on other shoulder workouts that you can preform in a gym.