1,460 views
0 votes
0 votes

Consider the query:


with dept total (dept name, value) as
(select dept name, sum(salary)
from instructor
group by dept name),
dept total avg(value) as
(select avg(value)
from dept total)
select dept name
from dept total, dept total avg
where dept total.value >= dept total avg.value;


Rewrite this query without using the with construct.

1 Answer

0 votes
0 votes
select D.dept-name from (select dept-name, sum(salary) as total_salary from instructor group by dept-id as D) where D.total_salary >= (select avg(salary) from instructor)

 

Related questions

0 votes
0 votes
1 answer
2
ajaysoni1924 asked Mar 30, 2019
716 views
Rewrite the where clausewhere unique (select title from course)without using the unique construct.