Self-join, Database Management System

Self-Join:  In a self join a table is joined with itself.  Let consider the following sample partial data of EMP table

EMPNO

ENAME

MGRID

.....

1

Nirmal

4

 

2

Kailash

4

 

3

Veena

1

 

4

Boss

NULL

 

.....

.....

...

 

Example: Search the name of each employee's manager name.

SELECT WORKER.ENAME || 'WORK FOR' || MANAGER.ENAME FROM EMP WORKER, EMP MANAGER

WHERE WORKER.MGR=MANAGER.EMPNO;

Output:

                                                                        2033_Self-Join.png

Posted Date: 3/11/2013 2:39:35 AM | Location : United States







Related Discussions:- Self-join, Assignment Help, Ask Question on Self-join, Get Answer, Expert's Help, Self-join Discussions

Write discussion on Self-join
Your posts are moderated
Related Questions
What is called mirroring? The simplest approach to introducing redundancy is to duplicate each disk. This method is called mirroring or shadowing.

Consider the E/R schema with weak entity sets shown below. Come up with the SQL CREATE TABLE statements (with appropriate primary key, unique and foreign key constraints). Include

What is a guard condition? Explain it with a suitable example. The guard-condition is a Boolean expression written with respect to parameters of triggering event and attributes


Give the reasons for allowing concurrency? The reasons for allowing concurrency is if the transactions run serially, a short transaction might have to wait for a preceding long

Consider the subsequent relations for a database which keeps track of business trips of salespersons in a sales office: SALESPERSON (SSN, Name, start_year, Dept_no) TRIP (SSN, Fr

Differentiate between the object oriented decomposition and the structured decomposition? Process-oriented (structural) decomposition divides a complex process, function or tas

How can we Classify the operations on classes  This step fundamentally means all three models functional, object and dynamic (studied in last section) must be combined so that

What is transaction? Transaction is a unit of program implementation that accesses and possibly updated several data items.

What is banker's algorithm?  Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances of each resource ty