For simply install a package do:
rpm -i package.rpm
Where "-i" is the Install parameter and "package.rpm" is the RPM you're installing. You can add more parameters to the above command, try this:
rpm -ivh package.rpm
The "-v" is for verbose and "-h" for the hashing marks. It'll print some "#" when unpacking and then installs the package. You can use "--percent" instead of "-h" if you want.
The above command is maybe the first RPM command you've learned. Upgrading to a New package can be done in 2 ways, the Freshen way and by executing:
rpm -Uvh new-package.rpm
Note that the "-U" Upgrading option simple removes the old and installed package, then install the new one. The "-Uvh" can be used to install a package too, if the package does not exist on your system the new-package.rpm will be installed.
Now imagine the situation where the new version of Samba you've just installed is not compatible with your applications, what to do? Answer: Upgrade to the old version. You can call this a "Downgrade" if you want. The command for install the Old package will be:
rpm -Uvh --oldpackage Samba-old-version.rpm
Where "--oldpackage" option says that Samba package version is older than the one installed. The command will remove the installed version and then install the Samba-old-ver.rpm.