What SQL is
🏠The everyday picture
Asking a librarian: "Please bring me all books by Premchand, published before 1930, sorted by title." You say what you want; the librarian decides how to find it.
📘What it really is
-
SQL (Structured Query Language) is the language for working with relational databases. It's declarative: you describe the result you want, and the database works out how to get it efficiently (much like React, Module 31).
-
Its main parts:
- defining structure (DDL):
CREATE TABLE,ALTER TABLE,DROP TABLE; - working with data (DML):
INSERT,SELECT,UPDATE,DELETE; - permissions (DCL):
GRANT,REVOKE(Module 58); -
transactions:
BEGIN,COMMIT,ROLLBACK(Module 57). -
SQL keywords are usually written in capitals for readability (
SELECT), but they aren't case-sensitive. Statements end with a semicolon. -
Text values go in single quotes:
'Patna'. (Double quotes are for names of tables or columns with unusual characters.) -
Comments:
-- like this. - SQL is over 50 years old and still one of the most valuable technical skills: almost every data job uses it, and AI tools write and explain it well, which makes reading it fluently even more useful.
🖱️Try it
Open crm.db in DB Browser and go to the Execute SQL tab. Run SELECT * FROM customers; (the * means all
columns). Then run SELECT name, city FROM customers;.
✅Quick check
Is SQL declarative or step-by-step?
Show the answer
Declarative: you describe the result, and the database decides how to find it.
How do you write the text Patna in SQL?
Show the answer
In single quotes: 'Patna'.
