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;

Comments

Popular posts from this blog

How to create React project using command prompt?

How to achieve abstraction?

Interview Question? How to find square of each element in this Array {2,4,5,6,8} using map ?