Ravindra BagaleCourses & study guides मराठी Track your progress

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

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
SELECT Basics and WHERE · Download PNG
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.

OperatorMeaning
=, <> or !=Equal, not equal
>, <, >=, <=Comparisons
AND, OR, NOTCombine conditions (use brackets to be clear)

Learn more in the lesson: 10.5 SELECT Basics and WHERE

See all Ravi Sir's Cyber Security Cards