uninstall rpm file package or dependencies

Always we use $sudo rpm -ivh rpm_file to install a package, but how to uninstall it?

1.If you know the name of your package which you want to uninstall, you just can use the following command to complete:
$sudo rpm -e package_name .rpm

Then the package will be uninstall from your computer.

2.When you forget the name or you just remember a part of the name, you can uninstall it following the steps:
$rpm -qa | grep -i key_words_of_package_you_want_uninstall

Then you will get a list of exact package names in which include the key words, then run
$sudo rpm -e exact_package_name

to uninstall it.

i.e.
I want to uninstall qt-x11, and I forget the exact package name, then:
$rpm -qa | grep -i qt
qt-4.6.2-28.el6_5.i686
qt-x11-4.6.2-28.el6_5.i686
qt-sqlite-4.6.2-28.el6_5.i686

$sudo rpm -e qt-x11-4.6.2-28.el6_5.i686

and the qt-x11 will be uninstalled.