Ravi Sir's Cyber Security Cards › Revision Cards
Subqueries
Subqueries A subquery is a query inside another query, in brackets. Example: WHERE fees > (SELECT AVG(fees) FROM students) . Blind SQL injection uses subqueries to ask yes/no questions, one letter at a time. Tools like sqlmap send thousands of these. The real fix is prepared statements . Using = whe

Read card text
What this card says
What it is
A subquery is a query inside another query, in brackets.
Example: WHERE fees > (SELECT AVG(fees) FROM students).
Why it matters for security
Blind SQL injection uses subqueries to ask yes/no questions, one letter at a time.
Tools like sqlmap send thousands of these. The real fix is prepared statements.
Common mistake
Using = when the subquery returns many rows. Error: “Subquery returns more than 1 row”. Use IN instead.
Learn more in the lesson: 10.10 Subqueries