What is the relational algebra of the "IN" and "NOT IN" query?

972 Views Asked by At

What is the relational algebra of the IN() / NOT IN() query?

1

There are 1 best solutions below

0
On

IN is basically OR, f.ex:

x IN (1,2,3)

is

x=1 OR x=2 OR x=3

NOT IN is just negation of it, so

x NOT IN (1,2,3)

is

NOT (x=1 OR x=2 OR x=3)

or following boolean logic

x<>1 AND x<>2 AND x<>3