I have 3 tables:
Classrooms
Courses
Members
This is the members
table
-----------------------------------------
| Member Name | Preferences |
-----------------------------------------
| Jhon Doe | CS201,CS304,CS604 |
| Neo | CS201,CS504,CS302 |
| Jhon | CS201,CS701,CS704 |
-----------------------------------------
Rules for preferences :
- If there are more than one faculty member willing to take a course then preferred faculty member for that courses will be the one with higher designation (e.g. CS201 and CS304 in the above ‘Preference List’ table).
My question :
How can I get the preferences of the members from the given members who are willing to take the one course among their`s preferences courses
------------------------------------------------------
| Course-Code | Willing Members | Preferred |
------------------------------------------------------
| CS201 | Jhon Doe,Neo,Jhon | Neo |
| CS304 | Jhon Doe,Neo,Jhon | Jhon |
------------------------------------------------------