Personally I would change the structure of the tables before proceeding further.
Instead of storing the preferences in separate columns, normalize the data and use another table. In this case it would mean that you would have tables like:
Student
-------
- studentid
- name
- ...
StudentPreference
-----------------
- studentid
- preferencestudentid
This would make it easier to later find preferences, handle the changes in preferences and so on.