def dbconn_table_num_rows(dbconn, tablename):
    """
    Helper function to calculate number of rows
    """
    query = f'select count(*) from {tablename}'
    return dbconn.cursor().execute(query).fetchone()[0]