1.

Show That, In Sql, <> All Is Identical To Not In?

Answer»

LET the SET S denote the result of an SQL subquery. We compare (x <> all S) with (x not in S). If a particular VALUE x1 satisfies (x1 <> all S) then for all elements y of S x1 ?= y. Thus x1 is not a member of S andmust SATISFY (x1 not in S). Similarly, suppose there is a particular value x2 which satisfies (x2 not in S). It cannot be EQUAL to any element w belonging to S, and hence (x2 <> all S)
will be satisfied. Therefore the two expressions are equivalent.

Let the set S denote the result of an SQL subquery. We compare (x <> all S) with (x not in S). If a particular value x1 satisfies (x1 <> all S) then for all elements y of S x1 ?= y. Thus x1 is not a member of S andmust satisfy (x1 not in S). Similarly, suppose there is a particular value x2 which satisfies (x2 not in S). It cannot be equal to any element w belonging to S, and hence (x2 <> all S)
will be satisfied. Therefore the two expressions are equivalent.



Discussion

No Comment Found

Related InterviewSolutions