I am stuck at the following SQL query:
Find the name of the departments having more than 12 instructors.
Ans should be given according to the given diagram.
uwopmtnx1#
Should be something like this:
select dept_name , count(ID) from instructor group by dept_name having count(ID) > 12
m1m5dgzv2#
use the group by and having clauses to filter on an aggregation function.
group by
having
select d.dept_name from department d inner join instructor i on i.dept_name = d.dept_name group by d.dept_name having count(*) > 12
2条答案
按热度按时间uwopmtnx1#
Should be something like this:
m1m5dgzv2#
use the
group by
andhaving
clauses to filter on an aggregation function.