SQL stands for Structured Query Language. It is designed for communicating with relational databases. Instead of opening a database file and changing bytes or lines ourselves, we write SQL statements and let the database management system find, add, change, or remove records.
Requests such as “show every user,” “show only names and emails,” “add a customer,” and “change one email address” can all be expressed as SQL.
SELECT name, email
FROM users;You can read this almost literally: select the name and email columns from users. Many SQL keywords resemble ordinary English, so the intent of a basic query is often visible.
What can SQL do?
At first, group SQL work into four operations: read, insert, update, and delete. You do not need to memorize every detail yet. Focus on what each statement changes.
SELECT * FROM products;INSERT INTO users (name, email)
VALUES ('Alice', '[email protected]');UPDATE users
SET email = '[email protected]'
WHERE id = 1;DELETE FROM users
WHERE id = 1;Notice WHERE id = 1: it limits a change or deletion to a particular record. A later lesson will teach filtering carefully.
Make statements change the data
This is an isolated database simulation. Choose an example or edit the SQL, run it, and inspect the table. INSERT, UPDATE, and DELETE persist inside the sandbox until you reset it.
| id | name | city | |
|---|---|---|---|
| 1 | Alice | [email protected] | Tokyo |
| 2 | Bob | [email protected] | Osaka |
| 3 | Chris | [email protected] | Tokyo |
| 4 | Diana | [email protected] | Kyoto |
Sandbox ready; no real database is connected.How SQL, a DBMS, and a database fit together
SQL is not a database or a product such as MySQL. SQL is the language. MySQL, PostgreSQL, SQL Server, and SQLite are database management systems that understand it. The actual records live in a database. You express the intent; the DBMS parses the statement, finds the table, and performs the operation.
Popular systems and syntax differences
MySQL, PostgreSQL, Microsoft SQL Server, and SQLite all support SQL, but advanced details are not identical. Pagination, date functions, and string functions often vary. MySQL and PostgreSQL commonly use LIMIT 10 to restrict results; SQL Server may use another form.
The core ideas behind SELECT, WHERE, INSERT, UPDATE, DELETE, JOIN, and GROUP BY remain similar. This course focuses on shared ideas and calls out product differences when they matter.
Semicolons and capitalization
A semicolon ; marks the end of a SQL statement. Some tools let you omit it when running one statement, but it clearly separates several statements in a script. SQL keywords are usually case-insensitive. Writing keywords in uppercase and table or column names normally makes the two easy to distinguish.
The real skill is not memorization
The important skill is turning a business question into something a database can process. For “find every user in Tokyo,” first ask: which table contains the data, which columns should appear, and what is the condition? Once you have users, the required columns, and city = 'Tokyo', you can assemble the SQL.
KNOWLEDGE QUIZ
Explain SQL in everyday language
Do not translate word by word. Explain each statement as a request to a coworker: what does it read or change? For the second statement, also say which records remain untouched.