Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / anuj barthwal

A self join applies on one table only

Example:

emp_id emp_name emp_manager_id

1 Anuj NULL

2 Sunny 1

3 Suraj 1

4 Narban 2


if we want to get the name of the managers

select e1.emp_name 'manager',e2.emp_name 'employee'
from employees e1 join employees e2
on e1.emp_id=e2.emp_manager_id

manager employee

Anuj Sunny

Anuj Suraj

Sunny Narban


Self join means joining the single table to itself

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I HAVE A PI ON COL A THE NEXT DAY I WANT CHANGE THE PI ON COL B? PLS SEND ME THE ANS

2857


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

1015


Explain about network model?

1007


In which table collections errors are stored.

2412


What are the three types of database design?

1025


Who are end users in dbms?

990


What you can do to remove data from the cache and query plans from memory for testing the performance of a query repeatedly?

1017


What is a database development?

966


What is the physical representation for a many-to-many relationship?

1078


How can I detect whether a given connection is blocked?

1055


What is dbms explain in brief?

1032


Explain about normal forms?

1058


What is an application role and explain a scenario when you would use one?

1012


Explain the rollup operator?

1077


Which four data types cannot be used as a return type from a user-defined function?

1024