Select the suitable option for displaying the average commission percentage of all employees, where the commission percentage column of certain employees include NULL value.Select one:a.select AVG(NVL(commission_pct)) from emp;b.select AVG(NVL(commission_pct,0)) from emp;c.select AVG(NVL(0,commission_pct)) from emp;d.select AVG(ommission_pct) from emp;
Question
Select the suitable option for displaying the average commission percentage of all employees, where the commission percentage column of certain employees include NULL value.Select one:a.select AVG(NVL(commission_pct)) from emp;b.select AVG(NVL(commission_pct,0)) from emp;c.select AVG(NVL(0,commission_pct)) from emp;d.select AVG(ommission_pct) from emp;
Solution
The correct option is b. select AVG(NVL(commission_pct,0)) from emp;
This is because the NVL function in Oracle is used to replace NULL values with another value. In this case, it replaces NULL values in the commission_pct column with 0. Then, the AVG function calculates the average of the commission_pct, including those employees with NULL values (which have been replaced with 0). This ensures that all employees are included in the calculation, providing a more accurate average commission percentage.
Similar Questions
The COMMISSION column shows the monthly commission earned by the employee. Emp_IdDept_IdCommission1105002201000310 410600530800630200710 820300 Which tasks would require sub queries or joins in order to be performed in a single step?Select one or more:a.Finding the number of employees who earn a commission that is higher than the average commission of the company b.Finding the total commission earned by the employees in department 10c.Listing the employees who earn the same amount of commission as employee 3d.Listing the departments whose average commission is more that 600 e.Listing the employees whose annual commission is more than 6000 f.Listing the employees who do not earn commission and who are working for department 20 in descending order of the employee ID
Consider the following table Employee.Select the output returned by the following query: SELECT branch AS department, AVG(age) AS average_ageFROM employeeGROUP BY branchHAVING COUNT(*) >= 2ORDER BY average_age DESC;
SELECT designation,avg(sales) from emp group by designation having avg(sales)>(SELECT avg(sales) from emp); explain it's working
To display the names of employees who earns more than the average salary of allemployees.SELECT last_name, first_nameFROMemployeeWHEREsalary > AVG(salary);Which change should you make to achieve the desired results?Select one:a.Change the function in the WHERE clause.b.Move the function to the SELECT clause and add a GROUP BY clause.c.Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.d.Use a subquery in the WHERE clause to compare the average salary value
SELECT c.nameFROM COMPANY cJOIN EMPLOYEE e ON c.company_id= e.company_idJOIN SALARY s ON e.employee_id = s.employee_idGROUP BY c.nameHAVING AVG(s.salary) >=40000
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.