Diwali offer: Flat 30% off on all courses plus free career counselling. Ends 5 Nov.Claim offer

What is SQL Injection? A Beginner’s Guide

SQL injection (SQLi) is one of the oldest and most common web vulnerabilities. Here is how it works, in plain English.

The idea

Websites often keep data, such as users and orders, in a database and talk to it using a language called SQL. If a website builds a SQL query by pasting in text typed by the visitor, a visitor can type SQL instead of normal text and change what the query does.

A simple example

Imagine a login form where the code builds this query:

SELECT * FROM users WHERE name = '[what you type]' AND password = '[what you type]'

The developer expects a name. But if the name field is treated as code, an attacker can type input that turns the condition into one that is always true, and the site may log them in without a password.

Why it is dangerous

How developers prevent it

Practice legally. Never test for SQL injection on a website you do not own or have permission to test. Safe practice labs are coming on our WAPT labs page.

Want to learn this hands-on with a trainer? Explore our Ethical Hacking course in Delhi.

Book a Free Demo WhatsApp Us