def remove_user_from_group(db, user_id, group_id):
    """Removes user from user group.

    Args:
        db (object): The db object
        user_id (int): User ID
        group_id (int): Group ID

    Returns:
        A boolean value indicating whether the given user was removed from the given group
    """
    db.execute("""DELETE FROM user_group_has_user
                  WHERE user_id = ? AND user_group_id=?""",
                (user_id, group_id,))

    return db.rows_affected != 0