Moving subject/Still camera:
In this technique you can get photos by having your camera completely still focusing on the moving subject. This will make the background or the setting of the photograph appear perfectly sharp and the motion blur effect will only be visible on the moving element.
Moving Subject/Moving Camera:
This is also called panning technique. In this technique you can photos by following the movement subject with the movement of your camera. It will make the background blurred while leaving the subject in focus.