Right now delete flag 0 means OK and 1 means deleted. If regard it as a status flag, I can add status 2 means intermediate result (dirty status). So when we update a row and suddenly server powers off, we can still tell which rows are in dirty status. Of cause when the update complete we reset it back to 0.
What do you think? After all dirty data cannot be used.
SCJP 6 with 93%
Oracle Database SQL Expert with 98%
It is not required, so just don't do it. It will overcomplicate (and maybe clutter) your code. Easy, simple code is preferred above more complex code. You won't get extra credit for little extras you put in the application, you might only loose points because it might not be flawless
I agree. I used to do stuff like that earlier in my career, but have since stopped. Though it seems to save time during development, those early gains are erased when it comes time to perform maintenance - you'll find yourself cursing those fields that have more than one use, like 'a combo delete-flag and status flag' or 'a combo delete-flag and last update date flag'. They make things confusing, fragile, and resistant to change.
You can't have everything. Where would you put it?
Devious Experiments for a Truly Passive Greenhouse!