nerdexam
PostgreSQL_CE

PGCES-02 · Question #136

A set of tables are defined as follows: t1 t2 How many rows are returned by executing the following SQL statement? SELECT * FROM t1 WHERE EXISTS (SELECT name FROM t2 WHERE t1.id = t2.id);

The correct answer is B. 2 rows. See the full explanation below for the reasoning.

Question

A set of tables are defined as follows:

t1 t2 How many rows are returned by executing the following SQL statement? SELECT * FROM t1 WHERE EXISTS (SELECT name FROM t2 WHERE t1.id = t2.id);

Options

  • A0 rows
  • B2 rows
  • C3 rows
  • D5 rows
  • E6 rows

How the community answered

(44 responses)
  • A
    16% (7)
  • B
    73% (32)
  • C
    5% (2)
  • D
    5% (2)
  • E
    2% (1)

Community Discussion

No community discussion yet for this question.

Full PGCES-02 Practice