in Databases retagged by
319 views
0 votes
0 votes

Write an SQL query 
“For every company -- including companies with no divisions -- find, and output, the company
and the number of divisions it has.” In this question you may not use any embedded SFW’s, nor
may you use any embedding operators, i.e., no IN, no NOT IN, no EXISTS, no NOT EXISTS,
and no <relational operator> ALL, <relational operator> SOME, or <relational operator> ANY.
Additionally, you may use GROUP BY, but you may not use HAVING.

 

in Databases retagged by
319 views

1 Answer

0 votes
0 votes
select co_name, count(co_name) from company, division where company.co_id = division.co_id group by company.co_id

Related questions