What is SQL?
The standard language for talking to relational databases
SQL (Structured Query Language) is the programming language you use to store, find, change and organise data inside a relational database. A relational database stores data in tables — grids of rows and columns, much like a spreadsheet — and SQL is how you ask questions like “show me every engineer earning over 80,000” and get exactly those rows back.
You write a statement
e.g. SELECT name FROM employees WHERE salary > 80000 — plain English-like keywords, no loops, no plumbing.
The engine parses it
The database checks your syntax and your column/table names against the schema, and rejects anything it cannot resolve before touching data.
The engine plans the work
It weighs indexes, table sizes and statistics to find the fastest internal strategy — you describe WHAT you want, it decides HOW.
Rows come back as a table
Matching rows return as a fresh result table — something you can read, sort, or feed straight into your application.
One language, reads and writes
SELECT reads, INSERT adds, UPDATE edits, DELETE removes, CREATE/DROP manage structure — the same grammar covers all of it.
1SELECT name, salary FROM employees;
| name | salary |
|---|---|
| Alice | 85000 |
| Cynthia | 91000 |
| Farid | 73000 |
This reads the employees table, keeps only the name and salary columns, and returns every row. Three statements do 95% of daily work: SELECT (read), INSERT (add), UPDATE/DELETE (change).
Read — SELECT
Asks a question and returns a result table without changing anything stored.
1SELECT name, salary FROM employees WHERE salary > 80000;
| name | salary |
|---|---|
| Alice | 85000 |
| Cynthia | 91000 |
Add — INSERT
Puts a brand-new row into a table.
1INSERT INTO employees (id, name, department, salary, age)2VALUES (7, 'Grace', 'Engineering', 81000, 31);
| id | name | department | salary | age |
|---|---|---|---|---|
| 7 | Grace | Engineering | 81000 | 31 |
Change — UPDATE
Edits values in existing rows in place.
1UPDATE employees SET salary = 88000 WHERE id = 1;
| id | name | department | salary | age |
|---|---|---|---|---|
| 1 | Alice | Engineering | 88000 | 29 |
Structure — CREATE
The same language also defines the tables the data lives in.
1CREATE TABLE departments (2 dept_id VARCHAR(30) PRIMARY KEY,3 location VARCHAR(30)4);
Recommended resourcesAffiliate links · may earn us a commission
Recommended for learners
Practice what you learned
Take the queries you just visualized and see the data structures that power real databases.