Given two tables A and B, both having a column ID, which SQL statement…

Given two tables A and B, both having a column ID, which SQL statement retrieves all IDs from table A that do not exist in table B?

  1. A.

    SELECT A.ID FROM A WHERE A.ID <> (SELECT B.ID FROM B);

  2. B.

    SELECT A.ID FROM A WHERE A.ID NOT IN (SELECT ID FROM B);

  3. C.

    SELECT A.ID FROM A, B WHERE A.ID != B.ID;

  4. D.

    SELECT A.ID FROM A WHERE A.ID EXISTS (SELECT ID FROM B);

Attempted by 463 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…