Without more details, it's hard to give a more detailed answer, but these are the basic steps.
Hi Priyanka Awari
You can do that by retrieving from the database and passing it into the loop and update the object based on your condition and commit the list.