🎴 Flashcard Mode
SQL Aggregates and Subqueries
Card1 / 15
Mastered0
Review0
QuestionClick to flip
Select a query to display the department wise average salary.
Consider the following relation schema ..... EMP(ENAME,EMPNO,SAL,COMM,DEPTNO,JOB,MGR,HIREDATE)...
AnswerClick to flip back
A
select avg(SAL) from EMP group by DEPTNO;
💡 Explanation:
We use group by for grouping with respect to any attribute , it will fetch the correct data.