Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7914493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:08:07+00:00 2026-06-03T14:08:07+00:00

This may seems the most dumbest question ever on stackoverflow but I am just

  • 0

This may seems the most dumbest question ever on stackoverflow but I am just wondering why would you write such a query:

Select e1.Emploee_ID, e1.Departement_ID From Employee e 
Inner join Employee E1 on e.employee_id= e1.Employee_ID
Inner join Departement d on d.dep_id= e1.departement_id

Why do we have to join on employee? my obvious query would be

select e.employee_ID, e.Departement_id from employee e 
inner join  Departement d on d.dep_id= e1.departement_id
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:08:08+00:00Added an answer on June 3, 2026 at 2:08 pm

    Referencing the PK with an inner join is redundant.

    You would normally join on the same table to link with another record, for example if you have a FK-column that reference the boss of an employee.

    Assuming you would have a nullable foreign-key column Boss_ID in table Employee

    Select e.Employee_ID, boss.Employee_id, d.Departement_ID 
    From Employee e  
    LEFT OUTER JOIN Employee boss on boss.Employee_ID=e.Boss_ID
    INNER JOIN Departement d on d.dep_id= e.departement_id
    

    Note that i’ve used a LEFT OUTER JOIN to get also the employee that have no bosses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

May be this question seems to be stupid, but strangely I find it hard
This may be a really simple question, but I'm not sure what the most
This may seem to be a IT question, but most IT people I asked
I know this question may seems stupid since i cannot give a lot of
This may seem like a simple question, but I can't find the definite answer:
This may seem like a really daft question, but what is the reason for
This may be a stupid question, but I'm still learning so do forgive me
This seems like the most common relationship but for some reason I cannot get
As you may know, pinterest api seems down now.( api.pinterest.com )In this site: http://tijn.bo.lt/pinterest-api
This may seem like a very basic question, since I'm not familiar with jQuery,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.