Management & CommerceVery hardBusiness analyst · SQL test

Table emp(id, name, dept, salary, mgr) has rows (1, Asha, Sales, 90, NULL), (2, Ravi, Sales, 60, 1), (3, Meena, Sales, 75, 1), (4, Kiran, Ops, 50, NULL), (5, Dev, Ops, 70, 4), (6, Neha, Ops, NULL, 4). How many rows does SELECT * FROM emp WHERE NOT (salary <= 65) return?

  1. A. 4
  2. B. 3
  3. C. 2
  4. D. 6

Correct answer: B. 3

Rows with salary > 65 qualify: Asha 90, Meena 75, Dev 70 = 3. Neha's NULL salary makes 'salary <= 65' unknown, and NOT(unknown) is still unknown, so she is excluded too. Expecting NULL rows to pass a negated condition gives 4.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic