SELECT, WHERE & ORDER BY · Question 14 · Medium

SELECT, WHERE & ORDER BY question 14

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

Which names match the pattern in this query?

SELECT name
FROM Students
WHERE name LIKE '_a%'
ORDER BY name;
  1. Aarav
  2. Kabir
  3. Aarav; Kabir
  4. Aarav; Diya; Kabir; Meena; Rohan; Sneha
Answer and explanation

Answer: C. Aarav; Kabir

Explanation: The underscore stands for exactly one character, so '_a%' means the second letter is a. That is true for Aarav and Kabir only; it does not mean 'contains a'.

Previous: A query has the clauses SELECT, FROM, WHERE, ORDER BY and LIMIT. In which… · 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