Computer Science, asked by kumbhanaganjaneyulu7, 8 days ago

waqtd number of departments present in employee table​

Answers

Answered by ajilkjohn
1

Answer:

SELECT DEPTNO,COUNT(DEPTNO)

FROM EMP

GROUP BY DEPTNO;

Explanation:

HERE WE CAN GET LIST OF DEPTNO AND HOW MANY TIMES THAT SAME DEPT REPEATS IN THE EMPLOYEE TABLE

Answered by AadilPradhan
0

MySQL query to display the number of departments present in the employee table​ is

SELECT COUNT(DISTINCT department) AS dept_count FROM employees;

  • DISTINCT is used select distinct departments in the employee table.
  • Here COUNT is used to count the number of the distinct department selected.
  • SELECT is used to select the required rows which satisfy the given constraint. It also displays the selected content.
  • AS is used as an alias for the selected content.

#SPJ3

Similar questions