What is a self join? Explain it with an example?
Answer Posted / sushant more (sybase dba)
CREATE TABLE EMPLOYEE(
[EMPLOYEE_ID] INT PRIMARY KEY,
[NAME] NVARCHAR(50),
[MANAGER_ID] INT
)
GO
INSERT INTO EMPLOYEE VALUES(101,'Mary',102)
INSERT INTO EMPLOYEE VALUES(102,'Ravi',NULL)
INSERT INTO EMPLOYEE VALUES(103,'Raj',102)
INSERT INTO EMPLOYEE VALUES(104,'Pete',103)
INSERT INTO EMPLOYEE VALUES(105,'Prasad',103)
INSERT INTO EMPLOYEE VALUES(106,'Ben',103)
select e1.NAME from EMPLOYEE e1,EMPLOYEE e2
where e1.EMPLOYEE_ID = e2.MANAGER_ID
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the physical representation for a many-to-many relationship?
Explain about a primary key?
Write short notes on manual refreshes.
Explain the role of indexing in databases?
Explain about the relational database?
Explain about the database management systems.
Explain about xml databases?
How to use online Backups?
What is dbms and its application?
On friday, you issued several insert statements using query analyzer. You then verified the data had been correctly entered with a select statement on monday, your users report that the data is not there what happened?
How to customize error conditions.
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 normalization? Explain different levels of normalization?
How long can an error message be in raiseerror function?
How would you design a database for an online site, which would average a million hits a day?