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
What is the maximum length of an extended property?
What is DB Development software?
Explain about xml databases?
Explain about the relational database?
What is dbms explain in brief?
Explain about post-relational databases?
Any sample or model question of punjab national bank for deputy manger IT or any sample of PNB.any1 plz do send on
What is dbms and its application?
Explain the rollup operator?
How can I detect whether a given connection is blocked?
What is an application role and explain a scenario when you would use one?
State the acid rules?
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?
Who are end users in dbms?
Can an extended stored procedure be called from inside a user-defined function?