category min and max from database