What is SQL?
SQL stands for Structured Query Language. It is the universal language used to create, read, update, and delete data stored in a relational database. Almost every application you have ever used — social networks, banking apps, e-commerce stores, SaaS platforms — stores its data in a relational database that is managed with SQL.
SQL is a declarative language: you describe what data you want, not how to retrieve it. You write SELECT * FROM customers WHERE country = 'BD' and the database engine figures out the most efficient way to find those rows. Compare this to imperative programming where you would loop over every record yourself.
SQL covers four major operation groups: querying data (SELECT), modifying data (INSERT / UPDATE / DELETE), defining structure (CREATE / ALTER / DROP), and controlling access (GRANT / REVOKE). This course teaches all of them.
A Brief History of SQL
SQL was invented in 1974 at IBM Research by Donald D. Chamberlin and Raymond F. Boyce. The original name was SEQUEL (Structured English Query Language), later shortened to SQL to avoid a trademark conflict. It was designed to work with IBM's System R — the world's first relational database prototype, built on Edgar F. Codd's 1970 relational model paper.
| Year | Milestone |
|---|---|
| 1970 | Edgar Codd publishes "A Relational Model of Data for Large Shared Data Banks" |
| 1974 | Chamberlin & Boyce create SEQUEL at IBM Research |
| 1979 | Oracle (then Relational Software) ships the first commercial SQL database |
| 1986 | ANSI standardises SQL — SQL-86 becomes the first official standard |
| 1992 | SQL-92 (SQL2) — the most widely implemented standard; still the baseline today |
| 1995 | MySQL and PostgreSQL released as open-source databases |
| 2003 | SQL:2003 adds window functions, XML support, and sequences |
| 2023 | SQL:2023 — latest ISO standard, adds JSON, property graph queries |
SQL has been standardised by both ANSI and ISO since 1986. The core language is stable and consistent across all major databases — which is why SQL skills you learn today are directly transferable between MySQL, PostgreSQL, SQLite, and SQL Server.
How SQL Works
When you run a SQL statement, it goes through several stages inside the database engine before any data is touched:
- Parsing — The engine reads your SQL text and checks it for syntax errors, producing an abstract syntax tree (AST).
- Semantic analysis — The engine verifies that the tables and columns you referenced actually exist and that you have permission to access them.
- Query planning — The query planner generates one or more execution plans and estimates their cost (using statistics about table sizes and indexes).
- Optimisation — The optimiser picks the lowest-cost plan — for example, deciding whether to use an index or scan the full table.
- Execution — The storage engine executes the plan: reading pages from disk, applying filters, joining tables, sorting results.
- Results — The final result set is sent back to your client application.
This declarative nature is SQL's greatest strength. As your tables grow from 100 rows to 100 million rows, you don't rewrite your queries — you add indexes and let the optimiser do the work.
SQL Dialects
Every major database implements the ANSI SQL standard and then adds its own extensions. These variations are called dialects. The core syntax — SELECT, INSERT, UPDATE, DELETE, WHERE, JOIN — is identical across all of them. Differences appear in advanced features like string functions, date handling, and procedural extensions.
| Database | Dialect | Best Known For | Licence |
|---|---|---|---|
| MySQL | MySQL SQL | Most popular web database; used by WordPress, Facebook | GPL / Commercial |
| PostgreSQL | PL/pgSQL | Most feature-rich open-source DB; best ANSI compliance | MIT-style (free) |
| SQLite | SQLite SQL | File-based, zero server, perfect for learning and mobile apps | Public domain |
| SQL Server | T-SQL | Microsoft's enterprise database; deep Windows integration | Commercial |
| Oracle | PL/SQL | Enterprise scale; used in banking and government | Commercial |
| MariaDB | MySQL-compatible | Open-source MySQL fork; used by Wikipedia | GPL |
All examples in this course use standard ANSI SQL syntax that runs in MySQL, PostgreSQL, and SQLite with no modification. Where a dialect difference is important, a note will highlight it.
Your First SQL Query
The simplest SQL statement you can run is a SELECT with no table at all. Open any SQL client — SQLiteOnline.com, MySQL Workbench, psql, or the SQLite shell — and type:
SELECT 'Hello, SQL!';
Now let's look at a realistic example. Given a customers table, here are the four fundamental SQL operations:
-- SELECT: read data
SELECT name, email FROM customers WHERE country = 'BD';
-- INSERT: add a new row
INSERT INTO customers (name, email, country)
VALUES ('Rahim', 'rahim@example.com', 'BD');
-- UPDATE: modify existing data
UPDATE customers SET email = 'rahim.new@example.com' WHERE id = 42;
-- DELETE: remove a row
DELETE FROM customers WHERE id = 42;
Notice how readable these statements are. SELECT name, email FROM customers WHERE country = 'BD' reads almost like plain English: "give me the name and email from the customers table where the country is BD." This is SQL's declarative nature in action.
What SQL Can Do — The Four Command Groups
SQL commands are grouped into four categories based on their purpose:
| Group | Full Name | Commands | Purpose |
|---|---|---|---|
| DQL | Data Query Language | SELECT | Read/query data from tables |
| DML | Data Manipulation Language | INSERT, UPDATE, DELETE, MERGE | Add, change, remove rows |
| DDL | Data Definition Language | CREATE, ALTER, DROP, TRUNCATE | Define and modify table structures |
| DCL | Data Control Language | GRANT, REVOKE | Control user permissions |
📋 Summary
- SQL stands for Structured Query Language — the standard language for working with relational databases.
- SQL is declarative: you describe what data you want; the database engine decides how to retrieve it.
- Created in 1974 at IBM by Donald Chamberlin and Raymond Boyce; standardised as ANSI SQL in 1986.
- Major dialects: MySQL, PostgreSQL, SQLite, SQL Server, Oracle — core syntax is the same across all.
- SQL covers four command groups: DQL (query), DML (modify), DDL (schema), DCL (permissions).
- Your first query:
SELECT 'Hello, SQL!';— runs in any SQL engine with no setup.
FAQ
SQL is technically a domain-specific language (DSL) for data management, not a general-purpose programming language. It lacks features like loops, variables, and functions in its core form. That said, most databases extend SQL with procedural features (PL/pgSQL in PostgreSQL, T-SQL in SQL Server) that add those capabilities. For practical purposes, "learning SQL" means learning the query language — you don't need procedural SQL to be productive.
More than ever. SQL has been in continuous use for over 50 years and shows no sign of being replaced. Every major cloud provider (AWS, GCP, Azure) offers managed SQL databases. Data tools like dbt, Spark SQL, BigQuery, and Snowflake all use SQL as their primary query language. Modern ORMs (SQLAlchemy, ActiveRecord, Django ORM) generate SQL under the hood. Knowing SQL gives you direct access to your data without going through an abstraction layer.
Both are excellent open-source relational databases. MySQL is the most widely deployed web database — fast, simple, and has enormous hosting support. PostgreSQL is more feature-rich, has stricter ANSI SQL compliance, better support for complex queries and JSON, and is the preferred choice for data-intensive applications. For learning SQL, the choice doesn't matter — the core syntax is identical. For a new project, PostgreSQL is the modern default recommendation.
No. SQL is one of the most beginner-friendly technical skills you can learn. Its syntax reads like English, results are immediately visible, and you can be productive within hours. Many non-programmers — analysts, product managers, marketers, and operations staff — use SQL daily to query databases without writing a single line of traditional code.