Write a stored procedure for emplpoyee and department table
to get DeptName which having no employee.
Table Structure-
Emp-Emp_Id,Emp_Name,Dept_id
Dept-Dept_Id,Dept_Name

Answer Posted / unnikrishnan nair r

CREATE PROCEDURE GetDept
AS
SELECT Dept_name from dept
WHERE Dept_Id NOT IN(SELECT DISTINCT Dept_id FROM Emp )

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default value of an integer data type in sql server 2005?

746


How you can change a cross join into an inner join?

718


What is open database communication (odbc)?

751


What is sql injection and why is it a problem? : sql server security

735


Explain what is log shipping?

812






how can you check the level of fragmentation on a table? : Sql server administration

709


What is the contrast amongst drop and truncate?

755


Is BCNF better than 2NF & 3NF? Why?

801


Define compound operators?

678


What are the filtered indexes?

780


What is partitioned view?

670


What is executereader?

724


Define right outer join?

715


What type of locking occurs during the snapshot generation? : sql server replication

1083


Distinguish between commit and rollback?

702