What is a self join? Explain it with an example?
Answer Posted / mike
You lost one Anju as Employee , because Anju does not have a
manager.
You should use left outer join in this case.
select e1.emp_name 'manager',e2.emp_name 'employee'
from employees e1 left outer join employees e2
on e1.emp_id=e2.emp_manager_id
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Explain the rollup operator?
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?
Explain about the relational database?
In which database can extended stored procedures be added?
You have a table with three columns: amount1, amount2, and amount3 in a single row only one of these three columns will have a value and the other two will be null. Write a sql query to retrieve the values from these columns?
What are the three types of database design?
What is DB Development software?
You are testing the performance of a query the first time you run the query, the performance is slow. the second time you run the query, the performance is fast. why is this?
How can you fix a poorly performing query?
What are the constraints on severity level in raiseerror?
Explain about a primary key?
What is normalization? Explain different levels of normalization?
To convert IDMS to DB2, how to deal with IDMS occurs and redefined clause?
How can you log an error to the server event log from a stored procedure?
The count() function always returns a int value type what should you do if you need to count rows from a query which you know will return a value that is too large for an int value type?