Write a sql Query as per given scenariostblEmployeeEmp_id Emp_Name Emp_Gender1 John Male2 Dean Male3 Mary FemaletblRelativesEmp_id Relatives_Id 1213 Write a query to get the output given below. Emp_id Emp_Name Father Morther1 John Dean Mary?
Satish Patel
select Emp_id,Emp_name, (select Emp_name from tblEmployee tb inner join tblRelatives tr on tb.Emp_id=tr.Relatives_id where tb.Emp_gender='Male') as father, (select Emp_name from tblEmployee tb inner join tblRelatives tr on tb.Emp_id=tr.Relatives_id where tb.Emp_gender='Female') as mother from tblEmployee where Emp_id in(Select distinct Emp_id from tblRelatives)