Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, use the following (short) tables department dept_name building budget Computer Science LWSN 800000 Statistics HAAS 500000 Mathematics MATH 600000 Physics PHYS 700000

image text in transcribed

image text in transcribed

For this assignment, use the following (short) tables department dept_name building budget Computer Science LWSN 800000 Statistics HAAS 500000 Mathematics MATH 600000 Physics PHYS 700000 instructor ID name dept_name salary 274 Clifton Computer Science 230346.16 295 Cleveland Statistics 277834.37 271 Li Computer Science 276520.42 307 Lee Statistics 117516.56 528 Li Mathematics 135651.95 1. Query Execution For each of the following queries, show the output when run on the above tables. Some may not be legal queries on the above relations, if not, explain why. In addition to giving the results, provide an English description, SQL, and relational algebra (whichever two are not given) for each query. 1. SELECT name FROM instructor WHERE id = 274 2. Obudget > 1000000 department 3. Isum(budget) department 4. Return the average salary in each department. 5. Ildepartment.dept_name_id, budget salary(Odepartment.dept_name=instructor.dept_name(department * instructor)) 6. Compute the "excess" budget for each department, after subtracting the salaries for that department. 7. select id, name from instuctor i, select max(salary) mx from instructor m where i.salary = m.mx 8. List the highest paid instructor in each department

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions