# SQL Fundamentals

> Understand SQL query structure, dialect differences across MySQL/MSSQL/PostgreSQL/Oracle, and how to detect an injectable parameter.

- **URL:** https://hackindex.io/learn/oswa-web-200-study-path/introduction-to-sql
- **Certification:** [OSWA (WEB-200) Study Path](https://hackindex.io/learn/oswa-web-200-study-path.md)
- **Estimated study hours:** 1.5
- **Published:** 2026-09-26
- **Updated:** 2026-09-27

Before exploiting SQL injection you need to understand SQL itself: how queries are built, how user input is concatenated into them, and how the syntax differs between database engines. The same injection often needs different payloads on MySQL, MSSQL, PostgreSQL, and Oracle. This module covers the SQL fundamentals and dialect differences that underpin every injection technique, then how to reliably detect an injectable parameter in a black-box target.

## SQL Fundamentals and Dialects

A SQL injection exists because untrusted input is placed directly into a query. Understanding query structure (SELECT, WHERE, UNION, subqueries, stacked statements) tells you where and how to break out of the intended query. Each engine has its own comment syntax, string functions, metadata tables, and version-specific quirks, so identifying the backend early determines which payloads will work.

## Detecting SQL Injection

Detection confirms that input reaches a query in an exploitable way. Error-based probes surface database error messages, boolean-based tests compare true/false responses, and time-based payloads confirm blind injection by measuring response delay. Injection is not limited to GET and POST body parameters: headers, cookies, and JSON fields are all candidates. Authentication bypass payloads and PHP loose-comparison hash tricks are quick wins worth testing on login forms.

## Study material

- [Database-Specific SQLi Syntax](https://hackindex.io/services/web/exploitation/sql-injection/database-specific-sqli-syntax.md) (read, core)
- [SQL Injection Detection](https://hackindex.io/services/web/vulnerability-discovery/sql-injection-detection.md) (read, core)
