Which of the following queries will you execute to accomplish the task?

You work as a Database Administrator for Domain.com. The company uses the MySQL database.
You have created a table named Employees. The table contains the following structurE.

The company has three departments. A task has been assigned to you to calculate the sum of the
average length of employees’ last name per department. Which of the following queries will you
execute to accomplish the task?

You work as a Database Administrator for Domain.com. The company uses the MySQL database.
You have created a table named Employees. The table contains the following structurE.

The company has three departments. A task has been assigned to you to calculate the sum of the
average length of employees’ last name per department. Which of the following queries will you
execute to accomplish the task?

A.
SELECT SUM(AVG(LENGTH(last_name))) FROM Employees ORDER BY department_id;

B.
SELECT SUM(AVG(LENGTH(last_name))) FROM Employees WHERE
department_id=NOT NU LL;

C.
SELECT SUM(AVG(LENGTH(last_name))) FROM Employees HAVING department_id;

D.
SELECT SUM(AVG(LENGTH(last_name))) FROM Employees GROUP BY department_id;



Leave a Reply 0

Your email address will not be published. Required fields are marked *