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
When a function module is activated syntax checking is performed automatically. YEs, a function module is activated syntax checking.

System error :These contain errors in database system or the OS, example, deadlocks.Such errors are fairly hard to detect and need reprogramming the erroneous components of the sys

Synonyms It allows short names or alternative names for objects. Example :               CREATE SYNONYM D30               FOR EMPD30;   Now if we give command:

Modular growth: In distributed environments, it is simple to expand. Latest sites can be added to the network without affecting the operations of other sites, as they are somewhat

E-R model uses this symbol to represent weak entity set ? A Doubly outlined rectangle symbol is used to represent weak entity set.

Which is a legal expression in SQL? SELECT NAME FROM EMPLOYEE is a legal expression in SQL.

Describe the Menu based interfaces for web clients or browsing? Menu-Based Interfaces for Web Clients or Browsing - These interfaces present the user along with lists of option

My cut off date is very soon in a Database subject and i dont know how to solve anything in it

Express the following queries in SQL: (a) Write the SQL code that will create ALL the four tables given in the appendix. Your answer should not contain the primary key and

Explain several types of constraints that can be specified using CREATE TABLE command. Explain CASCADE and RESTRICT clauses of DROP SCHEMA command? Constraint Description PRIM