Start learning 50% faster. Sign in now
Get Started with ixamBee
Start learning 50% faster. Sign in nowTo calculate the average salary of employees in each department, we need to use the AVG() aggregate function in SQL. The GROUP BY clause is essential here, as it groups the results by department, ensuring the average is calculated for each individual department, not for the entire table. The correct SQL query is: SELECT department, AVG(salary) FROM employees GROUP BY department This query returns the department and the average salary of employees in that department. Why other options are wrong: b) SELECT department, SUM(salary) FROM employees GROUP BY department : This calculates the sum of the salary, not the average. It’s useful when you want the total salary for each department. c) SELECT department, AVG(salary) FROM employees : This query is incomplete because it lacks the GROUP BY clause. Without it, it would give the average salary for the entire table, not by department. d) SELECT AVG(salary) FROM employees GROUP BY department : This query incorrectly places the aggregate function without selecting the department column, which will result in an error or incorrect output. e) SELECT department, COUNT(salary) FROM employees GROUP BY department : This counts the number of salaries in each department, not the average salary.
Select the term from among the given options that can replace the question mark (?) in the following series.
D4W, G5T, K9P, ?, S23H, V37E
Which of the following numbers will replace the question mark (?) in the given series?
108, 99, 88, ?, 60, 43
Select the combination of letters that when sequentially placed in the blanks of the given series will complete the series.
_ BCD _ _ ABC _ _ E _...
A cube is made by folding the given sheet. In the cube so formed, which letter will be on the face opposite to the face having 'F'?
Statements: All shoes are leather. Some leather are belts. Some belts are gold.
Conclusion I: Some shoes are belts.
Conclusion II: All belts are gold.
If ‘J @ I % H # G & F’, then how is I related to F?
The question given below has some statements followed by some conclusions. Taking the given statements to be true even if they seem to be at variance f...
Select the letter-cluster that can replace the (?) in the following series.
DEB, IJG, NOL, ?, XVV
Three of the following words are alike in some manner and hence form a group. Which word does NOT belong to that group? (The words must be considered as...
Three of the following four letter-clusters are alike in a certain way and one is different. Pick the odd one out.
AFKP
GKPS
SXCH
JOTY