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

What are POJO classes in spring? What is the use of POJO Class, and How to create POJO classes.

How to create React project using command prompt?