Sort:  

I can understand how it can be confusing. The snail photo has a shallow DOF because the lens was 6 inches from the snail when I took the shot. The closer you are, the shallower the depth of field. Even at f/22, the whole snail wouldn't have been in focus.

correct me if I am wrong
you can get shallow DOF either by using a big apperture but with further subject from lens,
or by getting so close to the subject.

Yes, using a longer focal length will give you a shallower DOF too.