Swastik Dey wrote:Not very sure, but might lead to some optimization issues. Please correct me if I am going wrong.
Looping is not required for this requirement, and will be much slower.
An index on student_id column is expected, and most likely it will exist if it is a primary key.
The index is expected anyway irrespective of any kind of update.