One language for (almost) every database.
SQL (Structured Query Language) is the language you use to talk to relational databases - MySQL, PostgreSQL, and SQLite all speak it, with only minor dialect differences. Data lives in tables (think spreadsheets: rows of records, columns of fields), and SQL is how you ask questions of it: "give me every order from this customer, newest first."
It's one of the best-value skills in software: learn it once and it transfers to virtually every database, every language, and every job - it has been the standard since the 1970s and isn't going anywhere.
Whenever your app stores structured data - users, posts, orders, anything with consistent fields and relationships between records. That's the vast majority of applications. The main alternative, document databases like Firebase, trade SQL's strict structure and powerful queries for flexibility and real-time sync.
users
table has one row per user and columns like id,
name, email. Each column has a type.
SELECT reads data, INSERT adds rows,
UPDATE changes them, DELETE removes
them. Most daily work is these four.
id; other tables reference it
(orders.user_id) to model relationships.
-- Every order over $50, with the customer's name,
-- newest first
SELECT users.name, orders.total, orders.created_at
FROM orders
JOIN users ON users.id = orders.user_id
WHERE orders.total > 50
ORDER BY orders.created_at DESC
LIMIT 10;
SQL is declarative: you describe what you want, and the database figures out how to fetch it efficiently.
INSERT a few rows, SELECT them back,
UPDATE one, DELETE one.
WHERE, ORDER BY, and aggregate
functions (COUNT, SUM,
GROUP BY) to your queries.
JOIN.
UPDATE or DELETE without WHERE. It changes every row. Run the same condition as a SELECT first, and use a transaction when you can.
= NULL. Nothing equals NULL, not even NULL. Use IS NULL and IS NOT NULL.
SELECT * in application code. Name the columns you need; it's clearer, faster and doesn't break when the table changes.
GROUP BY, every selected column must be grouped or aggregated (COUNT, SUM, MAX...).
The fastest way to practise is SQLite: it needs no server, and tools like DB Browser for SQLite let you run queries against a file on your own computer. Browser-based SQL playgrounds also let you experiment without installing anything.
When you want a "real" database server, free tiers from Neon or Supabase give you hosted PostgreSQL with a SQL editor in the browser. On shared hosting, phpMyAdmin gives you a SQL tab for MySQL.