SQL for beginners: the queries you’ll use every day
Written by LitCareer · 13 Oct 2026 · 2 min read
Learn SELECT, WHERE, GROUP BY and JOIN with simple examples, and how to practise for interviews.
What SQL is
SQL (Structured Query Language) is how you ask questions of data stored in databases. Data analysts, business analysts, data engineers, software developers and many operations roles use it daily. It is also one of the most common skills tested in data job interviews.
The core queries
- Select columns:
SELECT name, city FROM customers; - Filter rows:
SELECT * FROM orders WHERE amount > 5000; - Sort:
ORDER BY amount DESC - Limit results:
LIMIT 10(syntax varies slightly by database).
Summarising data
- Aggregate functions: COUNT, SUM, AVG, MIN and MAX.
- GROUP BY:
SELECT city, COUNT(*) FROM customers GROUP BY city; - HAVING: filter groups, for example cities with more than 100 customers.
Combining tables with JOIN
Data is usually split into tables, such as customers and orders. A JOIN connects them on a shared column: SELECT c.name, o.amount FROM customers c JOIN orders o ON c.id = o.customer_id;
- INNER JOIN: only matching rows.
- LEFT JOIN: all rows from the left table, with matches where available.
Next steps
After the basics, learn subqueries, CASE WHEN, date functions and window functions such as ROW_NUMBER and running totals. These come up often in interviews.
How to practise
- Install a free database such as SQLite or PostgreSQL, or use an online SQL practice platform.
- Load a public dataset and write 20 questions to answer with SQL.
- Practise explaining your query step by step, as you will in interviews.
Your next steps
- Learn SELECT, WHERE, GROUP BY and JOIN first
- Practise on a real public dataset
- Learn window functions before data interviews
- Explain each query step by step out loud
General guidance for learning, not professional, legal or financial advice. Want help for your own situation? Book 1:1 career help.


