Natural Join Tables

Viewed 2774

Instructor table: enter image description here

Teaches Table: enter image description here

When you do natural join on the two tables above using this query:

Select name, course_id
from instructor natural join teaches;

The output looks like this: enter image description here

In the above example, is instructor the left table and teaches the right table? Why is it that the first row in the result relation it has Srinivasan as the name. Shouldn't it have Einstein since that is the first row in the left table (instructor) and you are joining that with the right table (teaches)? So it will look at 222222 ID from instructor and see if that matches an ID from teaches, then it will look if 12121 (Wu) matches an ID from teaches, and so on. I am confused on how this output table is formed?

1 Answers
Related