waqtd number of departments present in employee table
Answers
Answered by
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
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
English,
4 days ago
French,
4 days ago
English,
4 days ago
Computer Science,
8 days ago
Math,
8 days ago
English,
9 months ago
Social Sciences,
9 months ago