SELECT, WHERE & ORDER BY · Question 10 · Medium

SELECT, WHERE & ORDER BY question 10

Table Students:
roll | name | city | marks
1 | Aarav | Pune | 78
2 | Diya | Mumbai | 91
3 | Kabir | Pune | 64
4 | Meena | Chennai | 91
5 | Rohan | Mumbai | NULL
6 | Sneha | Pune | 85

How many students does this query return?

SELECT name
FROM Students
WHERE marks <> 91;
  1. 2 rows
  2. 3 rows
  3. 4 rows
  4. 6 rows
Answer and explanation

Answer: B. 3 rows

Explanation: Aarav (78), Kabir (64) and Sneha (85) satisfy marks <> 91. For Rohan the comparison NULL <> 91 is unknown, not true, so his row is not returned.

Previous: Table Students: roll | name | city | marks 1 | Aarav | Pune | 78 2 | Diya |… · Next: Table Payments: txn_id | payer | app | amount | status 1 | Farhan | GPay | 250…

Practise select, where & order by

Try a fresh set of select, where & order by questions with an explanation after every answer, free and without signing up: SELECT, WHERE & ORDER BY practice. Or sit a full placement mock test.

More select, where & order by questions

More sql practice

SQL Joins · Aggregates & GROUP BY · Subqueries & CTEs · Window Functions · NULL Handling · SQL Functions & CASE · UNION, INTERSECT & EXCEPT · Tables, Keys & Constraints

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge