Ravi Sir's Cyber Security Cards › Revision Cards
SELECT Basics and WHERE
SELECT Basics and WHERE SELECT reads data. WHERE picks only matching rows. Example: SELECT name FROM students WHERE city = 'Pune'; The classic attack ' OR '1'='1 makes WHERE always true. In a login query, that can mean “logged in without a password”. Mixing AND and OR without brackets gives wrong ro

Read card text
What this card says
What it is
SELECT reads data. WHERE picks only matching rows.
Example: SELECT name FROM students WHERE city = 'Pune';
Why it matters for security
The classic attack ' OR '1'='1 makes WHERE always true.
In a login query, that can mean “logged in without a password”.
Common mistake
Mixing AND and OR without brackets gives wrong rows. Use brackets to show the order.
| Operator | Meaning |
|---|---|
| =, <> or != | Equal, not equal |
| >, <, >=, <= | Comparisons |
| AND, OR, NOT | Combine conditions (use brackets to be clear) |
Learn more in the lesson: 10.5 SELECT Basics and WHERE