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 / kannan

CREATE TABLE IF NOT EXISTS `emp` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) collate latin1_general_ci NOT NULL,
`dept_id` int(11) NOT NULL,
`mgr_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
)


SELECT e2.name Employee_name, e1.name Manager_name
FROM emp e1, emp e2
WHERE e2.mgr_id = e1.id

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about xml databases?

1009


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

1019


Explain about network model?

952


What are the three types of database design?

965


What is a database development?

910


What are the types of database model?

1030


When installing the datastage7.5x2 edtion iam getting aproblem i.e the cpu count is 2 but the cpu count in installation is one . how can i install in my p.c (system is dual core).

2163


Explain about the relational database?

1003


Explain the process of the user request and data generating?

1040


Explain the role of indexing in databases?

1075


fact table and dimension table containg one to many relationship or many to one relastionship

2448


Explain the cube operator?

939


Can an extended stored procedure be called from inside a user-defined function?

1009


What is data modeling with example?

910


If a column is an image value type, how you can compare column values? How can you use this column in join clause?

951