SQL & Queries


Answer & solution
Answer: Join EMP to DEPT and filter Location=Calcutta and Salary>50000. (no official key was published)
Use the common department identifier to join each employee to their department, then apply both predicates:
SELECT e."Employee-name" FROM EMP AS e JOIN DEPT AS d ON d."Dept-no" = e."Dept-no" WHERE d.Location = 'Calcutta' AND e.Salary > 50000;
The double quotes are standard SQL identifier quoting, required here because the printed attribute names contain hyphens. A database schema using Employee_name and Dept_no may use those unquoted names instead. The inequality is strict: salary exactly 50000 does not qualify. The department join is essential because Location belongs to DEPT, not EMP. This returns one row per matching employee under the usual department-key assumption; two employees sharing a name may produce duplicate name values. Add DISTINCT only if the intended output is a set of distinct names rather than names per employee. SQL NULL salaries do not pass the comparison.