considering non-empty database