Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
You want to create a list of managers and the number of employees reporting to them
Home
Oracle
You want to create a list of managers and the number of employees reporting to them
0
votes
asked
Jan 23
in
Oracle
by
SakshiSharma
You want to create a list of managers and the number of employees reporting to them. Write an Oracle SQL query to retrieve managers’ names and the count of employees reporting to each manager.
sql-query
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 23
by
SakshiSharma
SELECT m.employee_name AS manager_name, COUNT(e.employee_id) AS num_employees
FROM employees e
JOIN employees m ON e.manager_id = m.employee_id
GROUP BY m.employee_name;
...