Oracle 12c
I currently have the following three tables: Physician, Patient, and Wait_List. The Wait_List table is a bridge table to hold patients who are waiting on individual doctors.
I would like to track priority for each of these patients in a way other than the date they entered the wait list. For instance, if a given doctor is waiting on 3 patients each of these patients are assigned a value of 1-3 in their Priority field.
The issue I am having is figuring out how I would begin to write the procedure to enter a fourth patient who is to have a priority higher than 4, for instance a priority of 1. I understand that the procedure would require each of the 3 current patients' priorities to be pushed down in value.
Any guidance to this question would be greatly appreciated.
Thank you,