Question: Consider the query: Rewrite this query without using the with construct. with dept_total (dept_name, value) as (select dept_name, sum(salary) from instructor group by dept_name), dept_total_avg(value)

Consider the query:with dept_total (dept_name, value) as (select dept_name, sum(salary) from instructor group by

Rewrite this query without using the with construct.

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;

Step by Step Solution

3.36 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

There are several ways to write this query One way is to use subqueries ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Database System Concepts Questions!