What is a self join? Explain it with an example?

Answer Posted / dhivya

lets take a table A which is joined to itself with its
alias is said to be self join.Most familiar example is
finding the manager of the employee..

select e1.emp_id manager_id,e2.emp_id employee_id from
employee e1,employee e2
where e1.emp_id=e2.emp_id

Is This Answer Correct ?    66 Yes 37 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the database development process?

692


Explain the rollup operator?

615


How to use online Backups?

1733


What is database design and development?

606


On friday, you issued several insert statements using query analyzer. You then verified the data had been correctly entered with a select statement on monday, your users report that the data is not there what happened?

571






You are testing the performance of a query the first time you run the query, the performance is slow. the second time you run the query, the performance is fast. why is this?

527


In which table collections errors are stored.

1942


What is a database development?

524


How would you design a database for an online site, which would average a million hits a day?

585


Explain about query and reporting.

1694


What is dbms explain in brief?

568


What are the three basic rules which are to be followed for the relational model of the database?

566


You have two tables with a one to many join based on a field named id. You need to find records in the parent table that are not represented in the child table. how would you accomplish this?

598


In which database can extended stored procedures be added?

534


What is data modeling with example?

535