To select a random term from a dictionary, use gen_dictionary() : 

mysql> SELECT gen_dictionary(’DE_Cities’); +-----------------------------+ | gen_dictionary(’DE_Cities’) | +-----------------------------+ | Berlin | +-----------------------------+ mysql> SELECT gen_dictionary(’US_Cities’); +-----------------------------+ | gen_dictionary(’US_Cities’) | +-----------------------------+ | Phoenix | +-----------------------------+ 

To select a random term from multiple dictionaries, randomly select one of the dictionaries, then select a term from it: 

mysql> SELECT gen_dictionary(ELT(gen_range(1,2), ’DE_Cities’, ’US_Cities’)); +---------------------------------------------------------------+ | gen_dictionary(ELT(gen_range(1,2), ’DE_Cities’, ’US_Cities’)) | +---------------------------------------------------------------+ | Detroit | +---------------------------------------------------------------+ mysql> SELECT gen_dictionary(ELT(gen_range(1,2), ’DE_Cities’, ’US_Cities’)); +---------------------------------------------------------------+ | gen_dictionary(ELT(gen_range(1,2), ’DE_Cities’, ’US_Cities’)) | +---------------------------------------------------------------+ | Bremen | +---------------------------------------------------------------+ 

The gen_blocklist()  function enables a term from one dictionary to be replaced by a term from another dictionary, which effects masking by substitution. Its arguments are the term to replace, the dictionary in which the term appears, and the dictionary from which to choose a replacement. For example, to substitute a US city for a German city, or vice versa, use gen_blocklist()  like this: 

mysql> SELECT gen_blocklist(’Munich’, ’DE_Cities’, ’US_Cities’); +---------------------------------------------------+ | gen_blocklist(’Munich’, ’DE_Cities’, ’US_Cities’) | +---------------------------------------------------+ | Houston | +---------------------------------------------------+ mysql> SELECT gen_blocklist(’El Paso’, ’US_Cities’, ’DE_Cities’); +----------------------------------------------------+ | gen_blocklist(’El Paso’, ’US_Cities’, ’DE_Cities’) | +----------------------------------------------------+ | Bremen | +----------------------------------------------------+ 

If the term to replace is not in the first dictionary, gen_blocklist()  returns it unchanged: 

## Using Masked Data for Customer Identification 

mysql> SELECT gen_blocklist(’Moscow’, ’DE_Cities’, ’US_Cities’); +---------------------------------------------------+ | gen_blocklist(’Moscow’, ’DE_Cities’, ’US_Cities’) | +---------------------------------------------------+ | Moscow | +---------------------------------------------------+ 

At customer-service call centers, one common identity verification technique is to ask customers to provide their last four Social Security number (SSN) digits. For example, a customer might say her name is Joanna Bond and that her last four SSN digits are 0007 . 

