Speaking the language databases understand
Day 65 of 149
👉 Full deep-dive with code examples
The Restaurant Order Analogy
At a restaurant, you tell the waiter:
- "I'd like the pasta" → SELECT
- "Add extra cheese" → INSERT
- "Change my drink to water" → UPDATE
- "Cancel the dessert" → DELETE
SQL is how you tell databases what you want!
It's the language for asking questions and giving instructions.
What SQL Does
SQL (Structured Query Language) lets you:
- Ask questions → Find all customers from Sydney
- Add data → Insert a new order
- Change data → Update a customer's address
- Remove data → Delete an old record
All in simple, readable commands.
The Basic Commands
SELECT (reading data):
SELECT name, email FROM customers WHERE city = 'Sydney'
"Give me names and emails of Sydney customers"
INSERT (adding data):
INSERT INTO customers (name, email) VALUES ('Alice', 'alice@mail.com')
"Add a new customer named Alice"
UPDATE (changing data):
UPDATE customers SET email = 'new@mail.com' WHERE name = 'Alice'
"Change Alice's email"
DELETE (removing data):
DELETE FROM customers WHERE name = 'Bob'
"Remove Bob from the database"
Why SQL Matters
- Universal → Most databases use it
- Readable → Almost like English
- Powerful → Complex queries possible
- Been around forever → Lots of tools and knowledge
Key Concepts
- Tables → Like spreadsheets with rows and columns
- Rows → Each entry (one customer, one order)
- Columns → The properties (name, email, date)
- Queries → Questions you ask the database
In One Sentence
SQL is the simple, English-like language for asking databases to find, add, update, or delete data.
🔗 Enjoying these? Follow for daily ELI5 explanations!
Making complex tech concepts simple, one day at a time.
Top comments (0)