SQL (Structured Query Language) is the standard language used to interact with relational databases.
If you work with data, applications, analytics, or backend systems, SQL is a foundational skill.
This article is Part 01 of a 10-part SQL series, designed for:
SQL (Structured Query Language) is a declarative programming language used to create, read, update, and delete data stored in relational databases.
π‘ One-sentence definition (featured snippet friendly):
SQL is a language that allows you to query and manipulate structured data stored in relational database tables.
SELECT name
FROM customers
WHERE country = 'UK';
SQL follows a specific step-by-step process to get you your data:
SQL is a declarative language, meaning you describe what you want, not how to get it.
SELECT * FROM products WHERE price > 100;
The database decides:
| Category | Purpose | Commands |
|---|---|---|
| DQL | Query data | SELECT |
| DDL | Define structure | CREATE, ALTER, DROP |
| DML | Modify data | INSERT, UPDATE, DELETE |
| DCL | Control access | GRANT, REVOKE |
| Feature | SQL (Relational) | NoSQL |
|---|---|---|
| Schema | Fixed | Flexible |
| Query Language | SQL | Database-specific |
| Transactions | Strong | Often eventual |
| Use Case | Structured data | Massive or unstructured data |
π§ Analogy: SQL is like English; MySQL or PostgreSQL are like phones that let you speak it.
| Item | Case-sensitive |
|---|---|
| SQL keywords | β No (SELECT is the same as select) |
| Table & column names | β οΈ Depends on the OS/Database |
| String values | β οΈ Depends on collation settings |
SELECT * FROM employees;
SELECT first_name, last_name FROM employees;
SELECT * FROM employees WHERE department = 'HR';
INSERT INTO employees (first_name, last_name)
VALUES ('Jane', 'Doe');
UPDATE employees
SET department = 'Marketing'
WHERE id = 101;
UPDATE employees
SET department = 'Marketing'
WHERE id = 101;
DELETE FROM employees WHERE id = 101;
SQL for Developers
SQL for Data Analysts
Identify the table name, selected columns, and filter condition:
SELECT email FROM users WHERE active = true;
Write a query to select all columns from a table called products where the price is greater than 50.
Explain in plain English what this query does:
SELECT name FROM customers ORDER BY created_at DESC;
SQL sits at the intersection of software development, data analysis, and business intelligence. In the next article (SQL 02), weβll break down tables, rows, columns, and data types.
Happy querying! π
Exercise 1 β Identify the Parts
Query:
SELECT email FROM users WHERE active = true;
usersemailactive = true (This ensures you only get records for users who are currently marked as active).Exercise 2 β Write Your First Query
Task:
Select all columns from a table called products where the price is greater than 50.
Solution:
SELECT * FROM products
WHERE price > 50;
Exercise 3 β Think Like SQL
Query:
SELECT name FROM customers ORDER BY created_at DESC;
Plain English Explanation:
βGo to the customers table, grab the name of every customer, and list them starting from the most recently created (newest) down to the oldest.β
While we write SQL in the order of SELECT -> FROM -> WHERE, the database actually executes it in a different order to be efficient:
Next up: SQL 02 β Tables, Rows, Columns, and Data Types π