SQL · Question 19 · Easy
SQL question 19
Table Orders:
order_id | customer | city | amount
101 | Meera | Chennai | 1200
102 | Arjun | Bengaluru | 600
103 | Meera | Chennai | NULL
104 | Sana | Delhi | 1100
105 | Arjun | Bengaluru | 600
106 | Dev | Bhopal | 300
107 | Sana | Delhi | 400
What does this query return?
SELECT COUNT(*)
FROM Orders
WHERE city LIKE 'B%';
- 2
- 1
- 3
- 7
Answer and explanation
Answer: C. 3
Explanation: 'B%' matches values that start with B: Bengaluru (orders 102 and 105) and Bhopal (106). That is 3 rows.
Previous: If ORDER BY is used without ASC or DESC, in which order are the rows sorted? · Next: Which type of join returns all rows from both tables, matching rows where…
Practise sql
Try a fresh set of sql questions with an explanation after every answer, free and without signing up: SQL practice. Or sit a full placement mock test.
More sql questions
- Which keyword is written after SELECT to remove duplicate rows from a query's…
- In a LIKE pattern, which wildcard matches exactly one character?
- If ORDER BY is used without ASC or DESC, in which order are the rows sorted?
- Which type of join returns all rows from both tables, matching rows where…
- Table Orders: order_id | customer | city | amount 101 | Meera | Chennai | 1200…
- Table Orders: order_id | customer | city | amount 101 | Meera | Chennai | 1200…
- Table Orders: order_id | customer | city | amount 101 | Meera | Chennai | 1200…
- Table Orders: order_id | customer | city | amount 101 | Meera | Chennai | 1200…
- Table Orders: order_id | customer | city | amount 101 | Meera | Chennai | 1200…
- Table Orders: order_id | customer | city | amount 101 | Meera | Chennai | 1200…
More technical & programming practice
Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps · GenAI Basics · Pseudo-code · C Programming · Java
LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge