Self-join, Database Management System

Assignment Help:

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


Related Discussions:- Self-join

desirable properties of decomposition, Desirable Properties Of Decompositi...

Desirable Properties Of Decomposition Decomposition is a process of dividing a relation into its projections that will not be disjoint. Please remind the Relational projection

Data modelling, Law Associates is a large legal practice based in Sydney.  ...

Law Associates is a large legal practice based in Sydney.  You have been asked to design a data model for the practice based upon the following specification: The practice emplo

Table handling, Table Handling  In RDBMS more than one table can be tac...

Table Handling  In RDBMS more than one table can be tackled at a time by using join operation. Join operation is a relational operation that causes 2 tables with a common domai

Draw the precedence graph, Draw the precedence graph of the following sched...

Draw the precedence graph of the following schedule and determine whether the schedule is serializable. (Note that all instructions, except lock and unlock, are omitted. We assume

Attributes, Attributes and its types explain?

Attributes and its types explain?

Writing a pl/sql program, Problem 1. Create a PL/SQL program to insert ...

Problem 1. Create a PL/SQL program to insert data into student table and display the details of the student having Reg.No 1010 Writing a PL/SQL program to Insert data

Datamodels, explain thee diffrent types of data models

explain thee diffrent types of data models

What is foreign key, What is foreign key? A relation schema r1 derived ...

What is foreign key? A relation schema r1 derived from an ER schema may contain among its attributes the primary key of another relation schema r2.this attribute is known as a

What is system r?what are its two major subsystems?, System R was develop...

System R was developed and designed over a period of 1974-79 at IBM San Jose Research Company. Its purpose was to illustrate that it is possible to create a Relational System tha

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd