SQL query output type question
Q. Consider the following set of relations
EMP ( emp_no,emp_name,dept_no,salary)
DEPT (dept_no,dept_name,location)
Write SQL query for the following
Find all the employees whose departments are located in 'Mumbai' and salary is greater than Rs. 20,000.
- Published on 16 Jun 15a. select emp_name from dept where dept_no and location='Mumbai';
b. select emp_name from emp where salary > 20,000 and dept_no in (select dept_no from dept where location = 'Mumbai');
c. select dept_no ,count(emp_no) from emp where salary > 50,000 group by dept_no;
d. update table emp where emp_name='Mumbai';
ANSWER: select emp_name from emp where salary > 20,000 and dept_no in (select dept_no from dept where location = 'Mumbai');