I don't know if this is the best place to put this but here goes?

Does a database rewrite it's file everytime new data is stored? Is it able to selectively remove parts of it's file when data is to be deleted?

Thanks,

Paul