Q.we have two tables one is Employee table and another is city table in Employee table we have empId,empName and cityId and in City table we have cityId,cityName and stateName JOIN two tables WHERE empId =100 please write a Query for this.

Solution :-

SELECT e.empId,
e.empName,
e.cityId,
c.cityName,
c.stateName

FROM Employee e
JOIN City c ON e.cityId = c.cityId
WHERE e.empId =100;

Leave a Reply

Your email address will not be published. Required fields are marked *

*