Selecting, updating records in a second database

I need to write competition entries to a second Database not the main Drupal one but I can’t find any instructions on the SQL commands. I have found how to set up the second connection in settings.php but I can’t find how to do a select where on an email address to find out if someone has already entered. The page I have found is https://www.drupal8.ovh/en/tutoriels/159/database-basic-examples.

Thanks

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed