def query(connection, statement):
    """
    query sql command
    
    @Args:
    * [connection] connector
    * [statement] str

    @Returns:
    * [any] could be None, dict, list, depending on how many rows returned
    """
    with connection.cursor() as cursor:
        rows = cursor.execute(statement)
        res = None
        if rows > 1:
            res = cursor.fetchall()
        if rows == 1:
            res = cursor.fetchone()
        connection.commit()
        return res
