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 / sql pro

/*stored procedure for emplpoyee and department table
to get DeptName which has no employee records*/

select d.dept_name
from dept d
left join empl e
on d.dept_id = e.dept_id
where e.dept_id is null

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are transactions in sql?

737


what happens on checkpoint? : Sql server database administration

696


What is ms sql server service broker?

684


what method you can use to reduce the overhead of Reporting Services data sources?

202


How each E-R model constructs can be mapped to the relational model?

722






How to provide column names in insert statements in ms sql server?

807


Explain how to integrate the ssrs reports in application?

691


How to name query output columns in ms sql server?

713


Explain nested join?

740


How to convert character strings into numeric values?

775


How do triggers work?

692


Does an index slow down updates on indexed columns?

718


Why do we use non clustered index?

736


How to convert numeric values to integers in ms sql server?

699


Can you force a query to use a specific index?

693