do the nasty vs have sexual relations

do the nasty

verb
  • To engage in sexual intercourse. 

have sexual relations

verb
  • To have sex. 

How often have the words do the nasty and have sexual relations occurred in a corpus of books? (source: Google Ngram Viewer )