Skip to main content
added 308 characters in body
Source Link
J.D.
  • 39.5k
  • 12
  • 60
  • 134

I believe the term you're looking for is called Subquery which is what is injust read your WHERE clause inexamples closer and understand your question better now. Your second example but can be in the FROM clause too. Also to givethat you were doing uses a Subquerysubquery a specific name so you can reference it, you would usebut the first example your professor was doing is called an implicit inner join. It's just a shorthand way to write Table AliasFROM employee EMP INNER JOIN employee SUP ON SUP.employee_ID = EMP.supervisor_ID like @stickybit commented.

I believe the term you're looking for is called Subquery which is what is in your WHERE clause in your second example but can be in the FROM clause too. Also to give a Subquery a specific name so you can reference it, you would use a Table Alias.

I just read your examples closer and understand your question better now. Your second example that you were doing uses a subquery but the first example your professor was doing is called an implicit inner join. It's just a shorthand way to write FROM employee EMP INNER JOIN employee SUP ON SUP.employee_ID = EMP.supervisor_ID like @stickybit commented.

Source Link
J.D.
  • 39.5k
  • 12
  • 60
  • 134

I believe the term you're looking for is called Subquery which is what is in your WHERE clause in your second example but can be in the FROM clause too. Also to give a Subquery a specific name so you can reference it, you would use a Table Alias.