Introduction to the SQL Language

SQLEN-US

Lucas Lumertz

7/4/20253 min read

a painting of a wave
a painting of a wave

Hey everyone! Have you ever wondered how apps, websites, and companies store and access millions of pieces of information every day? How does Netflix know which movies you've watched? How does the bank find your statement in seconds? The answer lies in a powerful language called SQL!

Today, I'm going to explain what SQL is, what it's used for, and how it works—and best of all, I'll do it in a super simple way, as we always do. Ready to start?

What Is SQL?

SQL (Structured Query Language) is a language used to communicate with databases. Think of it as a translator between humans and computers when the topic is stored data.

For example:

  • You ask in SQL: "Which customers live in São Paulo?"

  • The database responds with a filtered list.

It's like asking questions to Google, but using a language that databases can understand!

What Is SQL Used For?

So, what is SQL actually used for?

✓ Retrieving information (like listing all the products in a store).

✓ Inserting new data (adding a customer registration).

✓ Updating records (changing someone's address).

✓ Deleting data (removing a canceled order).

✓ Organizing and analyzing (finding out how many sales were made this month).

Simple comparison: If a database were a giant Excel spreadsheet, SQL would be the set of commands you use to find, edit, or delete information in it. The difference from Excel or any other spreadsheet is that the database has much more performance and capacity to store your data.

Why Is SQL Important?

SQL is one of the most widely used languages in the world for a few simple reasons:

🔹 Almost all systems use databases (social media, banks, e-commerce).
🔹 It's easy to learn (the basic commands are similar to English).
🔹 It works everywhere (from small apps to gigantic systems like Google and Facebook).
🔹 It saves time (instead of searching manually, you ask the database a direct question).

Without SQL, it would be like searching for a book in a library without a catalog; it would be time-consuming and much more difficult!

Tools for Using SQL:

To start practicing, you can use:

  1. Free Databases:

    • MySQL → One of the most popular, used in websites and apps.

    • SQLite → Lightweight and easy for mobile applications.

    • PostgreSQL → Powerful for advanced projects.

  2. Online Platforms for Training:

  3. Visual Tools:

    • DBeaver → Free program to write and test queries.

    • MySQL Workbench → Ideal for those using MySQL.

    • PgAdmin → Ideal for those using PostgreSQL.

Examples of SQL Commands:

Now, let's look at some basic commands in practice:

1. To Create a Table (like a new spreadsheet):

CREATE TABLE customers (
id INT,
name VARCHAR(100),
age INT,
city VARCHAR(50)
);

2. To Insert Data (adding a customer):

INSERT INTO customers (id, name, age, city)
VALUES (1, 'Maria Silva', 28, 'São Paulo');

3. To Retrieve Information (filtering customers from São Paulo):

SELECT name, age FROM customers WHERE city = 'São Paulo';

4. To Update a Record (changing Maria's age):

UPDATE customers SET age = 29 WHERE name = 'Maria Silva';

5. To Delete a Record (removing a customer):

DELETE FROM customers WHERE id = 1;

Ah, Lucas, why didn't you include the output examples? To encourage you all to install a database and study for yourselves, or to use some of the links above, which already have a ready-made database where you can run your own queries.

Real-World Use Cases:

Now let's look at some examples of real-world use cases for SQL.

1. Social Media (Instagram, Facebook):

  • SQL retrieves your friends, posts, and messages when you log in.

2. E-commerce (Amazon, Mercado Livre):

  • Products are filtered by price, category, or rating using SQL.

3. Banks:

  • It queries your balance, statement, and transaction history in seconds.

4. Hospitals:

  • It quickly accesses patient medical records and exam results.

Conclusion

Let's recap what we learned today:

🔹 SQL is the language for talking to databases.
🔹 It's used to retrieve, insert, update, and delete data.
🔹 It's essential because almost every system uses databases.
🔹 Tools like MySQL and PostgreSQL help you practice.
🔹 Basic commands include SELECT, INSERT, UPDATE, and DELETE.

If you want to work with technology, data, or even create your own app, learning SQL is a superpower that will open many doors!

So, are you ready to write your first query? If you have any questions, leave them in the comments! 🚀 You are not alone on this journey, let's go for it!

📌 Want more content like this? Follow me so you don't miss the next posts!