Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (29.3k points)

my query is suppose we have three tables employee , department and building and I want aquery which could fetch me emp_name, phone_no,building name where emp_id=20. so how do i put where condition in the join of three tables?

1 Answer

0 votes
by (50.2k points)

This will do the magic for you.

select emp_name, phone, dep_name, building_name from employee e inner join dep d on e.emp_id = d.emp_id inner join building b on b.building_id = d.building_id;

Related questions

0 votes
2 answers
0 votes
1 answer
asked Jan 7, 2021 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...