SQL to determine if database is a risk as described in Hiper PTF - SO11864