I don't think
you should shift record numbers the way you do.
If your initial situation is (where "N" is the deleted flag):
0 record0 N
1 record1 N
2 record2 N
3 record3 N
4 record4 N
After you delete record 2, this should be:
0 record0 N
1 record1 N
2 record2 Y
3 record3 N
4 record4 N
When a new record is inserted, you can just overwrite the deleted record2, and the inserted record becomes the new record2. This way you don't have any "shifting".
Off course I don't know if you can use this solution with your assignment (I have the URLyBird one myself), since you will have to keep a "deleted" flag in your DB.