Let’s start with Basic SQL (Structured Query Language), the language used to work with relational databases.
1. Basic concepts
- A database is a collection of tables.
- A table is like an Excel sheet: it has columns (fields) and rows (records).
- SQL is used to create, query, insert, update and delete data.
Example of a Clients table:
| ID_Client | Name | City | Age |
|---|---|---|---|
| 1 | Anna Puig | Barcelona | 28 |
| 2 | Marc Solé | Girona | 35 |
| 3 | Laia Rius | Tarragona | 22 |
2. Basic queries (SELECT)
The most important command is SELECT, which is used to read data:
-- Select all columns
SELECT * FROM Clients;
-- Select only some columns
SELECT Name, City FROM Clients;
-- Filter data (only those from Girona)
SELECT * FROM Clients
WHERE City = 'Girona';
-- Order data by age
SELECT * FROM Clients
ORDER BY Age DESC; -- DESC = descending
3. Insert data (INSERT)
INSERT INTO Clients (ID_Client, Name, City, Age)
VALUES (4, 'Jordi Pons', 'Lleida', 30);
4. Update data (UPDATE)
UPDATE Clients
SET City = 'Madrid'
WHERE ID_Client = 2;
5. Delete data (DELETE)
DELETE FROM Clients
WHERE ID_Client = 3;
Ways to practice SQL:
1. Easy and quick option (no heavy install): SQLite + VS Code
SQLite is a very lightweight database (just one
.dbfile).You can install in VS Code the SQLite Viewer or SQLTools extension.
Perfect to start writing and running queries.
Online platforms (no installation required):
2. Intermediate option: MySQL or PostgreSQL installed on your computer
Edit the code in VS Code and run it with a client such as DBeaver or TablePlus.
Useful if you want to practice with more real and complex databases.
3. Advanced option: Docker + PostgreSQL/MySQL
VS Code connected to the database with extensions.
Ideal if later you want to build data or web projects.




