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

Enhanced entity relationship, what do you understand by enhanced entity-rel...

what do you understand by enhanced entity-relationship

Dataset, The dataset " CFOLYMPICS.XLS " contains the observations used in t...

The dataset " CFOLYMPICS.XLS " contains the observations used in the above article.  The definitions of the variables are also included in this spreadsheet.  However, for the purpo

Binary relationships, One-to-one relationship: For every 1:1 relationshi...

One-to-one relationship: For every 1:1 relationship type R in the ER diagram including two entities E1 and E2 we take one of entities (say E1) preferably with total participatio

Relational schema, crete a data base relationship model Entity: ...

crete a data base relationship model Entity: Students; Professors; Dormitories buildings; Attributes of students: Name; Address; Dorm;

Explain dbms- ddl-domain-alias, Briefly explain each of the following datab...

Briefly explain each of the following database terms. Use no more than 2-3 lines for each term. 1. DBMS 2. Update Anomaly 3. Alias (referring to tables in SQL queries)

Delete - referential integrity, During the deletion of a tuple two cases ca...

During the deletion of a tuple two cases can happen: Deletion of tuple in relation having the foreign key: In this type of case simply delete the desired tuple. For example, in

The basic 2pl-two phase locking (2pl), Normal 0 false false ...

Normal 0 false false false EN-US X-NONE X-NONE

Improve efficiency in query evaluation, Question: AirwaysCentre, an int...

Question: AirwaysCentre, an international airline booking company currently uses a relational database system for their operations, which includes the following relations: P

What is aggregate function, What is aggregate function? Briefly describe it...

What is aggregate function? Briefly describe it? Aggregate functions are functions that take a collection of values as input and return a one value. SQL offers 5 built-in aggre

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