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
Explain about xml databases?
What is the physical representation for a many-to-many relationship?
Explain about network model?
What are the three types of database design?
What is a database development?
What are the types of database model?
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).
Explain about the relational database?
Explain the process of the user request and data generating?
Explain the role of indexing in databases?
fact table and dimension table containg one to many relationship or many to one relastionship
Explain the cube operator?
Can an extended stored procedure be called from inside a user-defined function?
What is data modeling with example?
If a column is an image value type, how you can compare column values? How can you use this column in join clause?