Complete beginner? Start here.

What is SQL for? Discover its value through practice.

A customer orders 10 chairs. The store counts 8, the website 11: should the sale be accepted? Discover how a database creates reliable information and how SQL retrieves it.

  • Concrete example
  • Guided first query
  • No account to start
A new order arrives

Can we accept this sale?

The customer wants to buy10 chairs
The store reports
8chairs in stock
The sale must be refused
The website reports
11chairs in stock
The sale can be accepted
Two answers for one order.Without shared and controlled information, nobody knows which decision is reliable.

Several files, several truths

A local correction can create a global contradiction.

A spreadsheet is useful for exploring a small dataset or carrying out one-off analysis. When several teams and processes share, connect and change the same facts, a database provides common structure and rules.

See how to choose without opposing the tools
Illustration of connected customer, order and product tables in a learning environment

Before and after

A database does not replace business knowledge: it makes facts controllable.

Before

Uncoordinated sources

  • Inconsistent names and definitions
  • Relationships that cannot be checked
  • Invisible concurrent changes
  • Reports that are hard to reproduce
With a relational database

A structured, shared source

  • Documented tables and types
  • Controlled keys and relationships
  • Constraints and transactions
  • Reproducible questions with SQL

Far more than SELECT

SQL structures, queries, changes, controls, secures and automates.

Start with six essential families. Advanced capabilities and their actual availability are documented separately.

Model

Separate customers, orders and payments without losing their relationships.

SQL · PostgreSQL

Query

Turn a business question into a reproducible result.

SQL · PostgreSQL

Change

Add, correct or remove data precisely.

SQL · PostgreSQL

Protect integrity

Reject negative prices, duplicates and orphaned relationships.

SQL · PostgreSQL

Manage transactions

Confirm or cancel several related changes together.

SQL · PostgreSQL

Create views

Reuse one shared definition across several reports.

SQL · PostgreSQL

Your first visible answer

Run a query on six fictional orders.

It totals amounts by city and places the highest revenue first. The SQL environment loads only when you click Run.

Browser-based SQL environment

Which city generates the most revenue?

Run a read-only query on this exercise's fictional data. Nothing is sent to SQL.tn.

Local and private
Shortcut: Ctrl/⌘ + Enter
The SQL environment will be prepared when you first run the query.

Free micro-course · 35 to 45 min

Why does SQL exist?

Understand why companies use databases, then write your first query to solve a real problem.

  • Identify the limits of uncoordinated sources
  • Distinguish database, DBMS, server and SQL language
  • Understand tables, keys, relationships and constraints
  • Connect a business need to a SQL capability
01 · Spot contradictions02 · Connect the right tables03 · Choose the rules04 · Map SQL capabilities05 · Answer with SQL
20published lessons
44exercises with validation
2available projects
20practical guides

Structured learning path

Continue with SQL Foundations.

From your first query to a complete business analysis: filters, calculations, dates, aggregations, joins and CTEs.

Available

SQL Foundations

SELECTWHEREGROUP BYJOINCTE
20 lessons44 exercises in the catalogueView learning path

Practice and business cases

Validate a query, then build an analysis.

SELECTNo account

Select the correct columns

Show only the name and price of each product.

Level : BeginnerOpen exercise
WHERE · ORDER BYNo account

Filter and sort orders

Find orders over 50 TND, from highest to lowest.

Level : BeginnerOpen exercise
Business projectAvailable

Analyse sales across a store network

Build revenue indicators from fictional sales across several cities and channels.

  • Calculate total revenue.
  • Compare revenue by city.
  • Compare in-store and online sales.
Create a space for the project

Focused skills

Upcoming micro-courses are visible, but not yet for sale.

Join a waiting list only when the promised outcome matches your need.

In preparation45 to 60 min

SQL, PostgreSQL, MySQL and SQL Server: what is the difference?

Distinguish language, database, DBMS, server and dialect, then recognise the differences that matter.

View prerequisites and planned syllabus

Current offers

Try for free, then choose SQL Essentials if the path suits you.

Micro-courses in preparation do not change the price or terms of SQL Essentials.

Available with a free account

Discovery

To test the method and build your first SQL habits.

Free

  • 8 foundation lessons
  • 15 interactive exercises with solutions
  • Guided Sales Analysis project (free account required)
  • Level test and SQL environment
  • Progress linked to your account
Create my free space

Guides connected to practice

Explore a question, then move on to the activity.

A barrier refuses an invalid value, a capsule secures two operations and a sensor archives a change

Constraints, transactions or triggers: which tool to choose?

These three tools protect data at different times. Confusing them adds complexity without improving reliability.

Read the guide
Two counters compare all lines to the cells actually filled in

COUNT(*) or COUNT(column)?

The difference seems small, but it can change a completeness or volume KPI.

Read the guide
An analyst uses an individual spreadsheet linked by a bridge to a database shared by several collaborators

Excel or database: how to choose?

The right choice does not depend on a duel between tools, but on the way in which your data lives and is shared.

Read the guide

Frequently asked questions

Before you begin.

What is SQL?

SQL is a language used by several database management systems to structure, query, modify and control data. PostgreSQL, MySQL and SQL Server are DBMSs, not synonyms for SQL.

Who is SQL.tn for?

SQL.tn is for students, career changers and professionals who want to learn SQL or strengthen their data skills.

Do I need to install software?

No. You can read lessons, view solutions, take the test and use the interactive SQL environment directly in your browser.

What does free access include?

After three activities available without an account, the free Discovery space unlocks 8 lessons, 15 exercises with solutions, the level test, SQL environment and guided Sales Analysis project. The project requires a free account to save progress.

Can I learn without programming experience?

Yes. The free Why does SQL exist? micro-course starts with conflicting files before introducing tables, relationships and the first query.

View the full FAQ