Question: ( 2 Marks ) The UNIQUE operator evaluates to true if there are no duplicate tuples in the result of some subquery. This operator does

(2 Marks) The UNIQUE operator evaluates to true if there are no duplicate tuples in the result of
some subquery. This operator does not exist in Postgres. The following query returns each
employee who has exactly one dependent. Rewrite this query so it will run in Postgres. Use a
subquery.
SELECT *
FROM employee c
WHERE UNIQUE
(SELECT essn
FROM dependent d
INNER JOIN employee o
ON o.ssn= d.essn
WHERE o.ssn=c.ssn);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!