def get_department_average_salary_service(department):
    """
    Returns department average salary from db
    :param department: department
    :return: department average salary
    """
    average_salary = 0
    if department.employees:
        for employee in department.employees:
            average_salary += employee.salary
        average_salary /= len(department.employees)
    return round(average_salary, 2)