SQL stands for Structured Query Language.
SQL is a standard language used to communicate with relational databases—to store, retrieve, update, and manage data.
In simple terms:
👉 SQL is how you talk to databases like MySQL, MariaDB, PostgreSQL, and SQL Server.
What SQL is used for
- Creating databases and tables
- Inserting new data
- Reading (querying) data
- Updating existing records
- Deleting records
- Managing users and permissions
Basic SQL example
SELECT name, email
FROM users
WHERE active = 1;
This means:
➡️ “Get the names and emails of all active users.”
Core SQL operations (CRUD)
- CREATE – make tables/databases
- READ – query data (
SELECT) - UPDATE – change data (
UPDATE) - DELETE – remove data (
DELETE)
Key SQL concepts
- Tables → rows & columns
- Primary key → unique row identifier
- Foreign key → links tables together
- Indexes → speed up searches
- Joins → combine data from multiple tables
SQL vs databases
Important distinction:
- SQL = the language
- MySQL / MariaDB / PostgreSQL = database systems that use SQL
Think of it like:
- English = SQL
- Different people = MySQL, MariaDB, PostgreSQL (all speak English with accents)
SQL in web development
Typical flow:
- User submits a form
- Backend code (PHP, Python, Node.js) runs SQL
- Database returns results
- Webpage displays data
Variants
Each database adds small differences:
- MySQL / MariaDB → MySQL-style SQL
- PostgreSQL → more strict, feature-rich SQL
- SQL Server → T-SQL
But core SQL is universal.
