🗄
Lecție 17 · clasă 15+
Databases and SQL: where the data lives
📖 Lecție
──▶
🎯 Quiz — alege traducerea
──▶
✅ Lecție parcursă
A database is tables with rules. The user is the row, the fields are columns: id, name, email. SQL is the question language: SELECT (give), INSERT (add), UPDATE (change), DELETE (remove). On our site listings, users, cities — all live in the database. SELECT * FROM users WHERE city = "Berlin" — "show all Berlin users".
- ●SELECT name, price FROM goods WHERE price < 100 — filter
- ●Relations: the listing has user_id — "who is the author"
- ●An index is like a book index: searches millions instantly
🗄 SQL injection is when an attacker "queries" the database through an input field: '; DROP TABLE users;-- . That is why code always filters input!