Correct Answer - Option 3 :
SELECT DISTINCT EMPID
FROM PROJECTWORK
WHERE PROJNO IN (20, 30, 40);
The correct answer is option 3.
Since the primary key is a combination of two keys (EMPID, PROJNQ) so duplicate values may occur in EMID and PROJNQ. So distinct keys are required to eliminate duplicates in the combined table. And IN is a set operator it matches all table values to the set values.
∴ Hence the correct answer is the below query.
SELECT DISTINCT EMPID
FROM PROJECTWORK
WHERE PROJNO IN (20, 30, 40);