The 50mm f1.8 is a Nikkor lens - so it will fit Nikons - it's the "Prime" lens I'm always loving on in this thread. However...it will *not* auto-focus on your camera (the D5000), nor will it AF (autofocus) on the D40 or D60....just fyi. You'd have to manually focus it
at all times...and this is pretty tough (I found, when I had the D40) esp. when trying to take pictures of moving things, like doggies

.
Breny, if you want a prime lens (a non-zooming lens) - you need to get one that has the focus motor IN the lens for the D5000.
{
refresher -- the "fun" of having a
Prime lens is that you have total control over the aperture (aka f-stop),
meaning, you can really obtain a blurred background, aka "bokeh"; when you open wide to, say, f1.8 - you have a very "shallow" depth of field,
meaning, only a little area is in focus...the rest is blurry...hope that makes sense

.}