Lesson Beginner

What is SQL?

SQL stands for Structured Query Language.
If a database is where data lives, SQL is how you ask it questions.

It is one of the fastest ways to answer real questions with data.

Analysts, product teams, and developers all use SQL to inspect what is happening in the data and make decisions with evidence.

SQL in One Sentence #

SQL is a declarative language.
That means you describe the result you want, and the database engine decides the execution details.

For example, you can ask for "paid orders from last month," and SQL figures out how to filter and return those rows.

Where SQL Shows Up in Real Work #

Teams usually use SQL in two modes.

  • In app databases, SQL helps create and update records like users, orders, and statuses.
  • In analytics workflows, SQL is used to calculate metrics, build reporting tables, and answer business questions.

Those reporting tables are often connected to tools like Excel, Power BI, Looker, and Tableau to create reports and dashboards.

Your First Query #

Start with something small and readable:

sql
SELECT id, name, email
FROM users
LIMIT 3;

Plain English: "Show id, name, and email from table users, up to three rows."

A possible result could look like this:

idnameemail
1Alice Johnsonalice@example.com
2Bob Smithbob@example.com
3Carol Daviscarol@example.com

You asked for three columns, so only those columns appear.
You used LIMIT 3, so the database returns at most three rows.

Run this query, then make one small change at a time.
Try changing the limit, removing a column, and adding ORDER BY id DESC so you can see how output shape and order change.

Loading SQL editor...

ANSI SQL and Dialects #

You will often hear "ANSI SQL" and "SQL dialect."
ANSI SQL is the shared standard.
A dialect is the flavor a specific system adds on top.

Most core clauses are portable, but details can differ.
Example: many engines use LIMIT 10, while some systems use TOP 10.

sql
-- Some systems
SELECT TOP 10 * FROM table;

-- Many engines
SELECT * FROM table LIMIT 10;

How This Course Uses SQL #

This course focuses on analytical SQL.
That means you will mostly write SELECT-based queries to explore data, summarize it, and explain what happened.

As you progress, you will still pick up broader SQL concepts so you can move across different systems with confidence.

Knowledge check #

3 questions

0 / 3 answered
  1. SQL is a declarative language. What does that mean?

  2. Different databases (Postgres, MySQL, SQL Server, BigQuery) all run SQL, but their dialects differ. The differences are:

  3. In SQL, the order you write clauses is SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY. Which clause runs first logically?

Next Step #

Continue to SQL syntax to learn clause structure and query flow in more detail.