Introduction
A cursor lets you go through rows in a table one by one. It helps when you want to do something with each row separately.
When you need to process each row of a query result step by step.
When you want to update or check rows one at a time.
When a task depends on the data from the previous row.
When you cannot do the work with a single SQL statement.
When you want to print or log each row's data during processing.