Question: 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)

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 importthing What I wrote down now is not working and I useda different table content because it's not on the table. Please use

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!