SQL – Basic Level Exercices

A hands-on SQL practice using the Clients table: select by city (Barcelona), project Name and Age, insert a new row (Paula Serra, 27, Girona), and filter clients over 30. Includes commented code and step-by-step screenshots to solidify SELECT and INSERT syntax.

SQL - Basic Exercices

🧭 Role: Exercice
🗂️ Area: Data Science
📅 Year: 2025
🧩 Stack: SQL
📝 Credits: me

From the following table (File –> Clients.sql)

-- Create the Clients table
CREATE TABLE Clients (
ID_Client INT PRIMARY KEY,
Name VARCHAR(50),
City VARCHAR(50),
Age INT
);


-- Insert sample data
INSERT INTO Clients (ID_Client, Name, City, Age) VALUES
(1, 'Anna Puig', 'Barcelona', 28),
(2, 'Marc Solé', 'Girona', 35),
(3, 'Laia Rius', 'Tarragona', 22),
(4, 'Jordi Pons', 'Lleida', 30),
(5, 'Carla Vives', 'Barcelona', 40);


Select all clients from Barcelona.

SQL BASIC LEVEL EXERCISES

Show only the names and ages of the clients.

SQL BASIC LEVEL EXERCISES

Add a new client: “Paula Serra” from Girona, aged 27.

SQL BASIC LEVEL EXERCISES

Which clients are older than 30?

SQL BASIC LEVEL EXERCISES

 


Leave a Reply

Your email address will not be published. Required fields are marked *