@akhilendharreddy so the main thing to do here is to stop thinking about it in terms of a loop.
As I described in my original reply, you can use the split node to turn a single message returned by the mysql query node into a stream of multiple messages, one for each element in the result from the query:
[Inject] -> [MySQL Query] -> [Split] -> [... something ...] -> [Mysql Query] -> [... something ...]
This means if the first MySQL query node returns a message with a payload of
[1,2,3,4], then when you pass that through the Split node, you'll get a sequence of messages:
Each of those messages will pass down the rest of the flow, so you can do whatever processing you want for the individual student ids.