def METHOD_NAME(app):
    with app.app_context():
        sql = """SELECT j.id, count(distinct a.id), count(distinct r.id)
                 FROM journalists AS j
                 LEFT OUTER JOIN journalist_login_attempt AS a
                 ON a.journalist_id = j.id
                 LEFT OUTER JOIN replies AS r
                 ON r.journalist_id = j.id
                 GROUP BY j.id
                 ORDER BY j.id
              """
        return list(db.session.execute(text(sql)))