Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read everything Please give me the code that fits the question. Please give me the code that fits the question. It's really important. And

Please read everything

Please give me the code that fits the question. Please give me the code that fits the question. It's really important. And please use the table in the screenshot I uploaded.

very import thing What I wrote down now is not working and I used a different table content because it's not on the table. Please use the contents in the table I attached and give me the code that fits the question, and don't give me the code again because the code I wrote down now is wrong. I asked you a question again, and you said the wrong code I posted, but I'd be really angry if you gave me the same one.

And the section table does not contain the dept_name. I don't understand why you're doing section.dept_name and why you're using s.dept_name instructor.dept_name here. Please give me the right code for the question. Don't use anything weird and make sure to look at what's on the table.

wrong code

select distinct instructor.ID , instructor.name

from instructor join teaches on instructor.ID = teaches.ID join section on teaches.course_id = section.course_id and teaches.sec_id = section.sec_id

where instructor.dept_name = section_dept_name

and not existis(

select *

from teaches t join section s on t.course_id = s.course_id and t.sec_id = s.sec_id

where t.ID = instructor.ID and s.dept_name instructor.dept_name

Question

Find the ID and name of the instructors who taught at least one course in their own departments but did not teach any courses in other departments. Remove duplicates in the result.(join on)

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

Step: 3

blur-text-image

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

EXPLAIN how to develop an orientation program.

Answered: 1 week ago

Question

=+1 What would you do if you were the IHR manager?

Answered: 1 week ago