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 an example of a foreign key?

594


What is default port number for sql server 2000?

680


What is table join?

693


How and why use sql server?

632


What do you understand by the analysis services in sql server?

629






Explain trigger and its types?

703


what are database files and filegroups? : Sql server database administration

580


What is default constraint?

623


What are the different types of collation sensitivity?

660


What are synonyms?

626


What is the correct order of the logical query processing phases?

608


What is built-in/administrator?

648


what is difference between view and Dip.

2099


what's new in sql server 2016?

645


What are the types of dml?

641