How to build a sql query in joomla?

This post is for Joomla beginners, who start’s learning in Joomla development. These four queries are very common and used every time in the module, plugin and component development for retrieving, inserting, updating and deleting operation. In this post, I am explaining all these queries with #__users table.