What are we supposed to be using at the moment? It feels like this has changed over the last few years.
How do you design queries relating to alerts correctly?
See https://github.com/solarwinds/OrionSDK/wiki/Alerts for details about working with alerts via the API. It's generally preferable to avoid working directly with the database tables if you can avoid it.