Summary - Security and backup
- SQL course
- Expert
- Lesson 41/45
- 5 min
Build a secure setup with GRANT and prepared statements.
Summary - Security and backup
Security and backup: PREPARE against SQL injection, GRANT/REVOKE for privileges, COPY TO for backup, COPY FROM for recovery. Least privilege and regular backups are core principles.
-- PREPARE -> GRANT -> COPY TO -> COPY FROM
-- en az yetki, düzenli yedekSecurity and backup go hand in hand.
Practice Summary - Security and backup
Summary task: give the reader role read access on orders.
Starter code
-- summary security
GRANTSample solution
GRANT SELECT ON orders TO reader;Expected output
GRANT
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Read permission
GRANT SELECT ON orders TO ____
GRANT SELECT ON orders TO reader
Explanation: Read access is granted with GRANT SELECT; the reader role can only run SELECT.
2 What is used against SQL injection?
- INDEX
- TRIGGER
- PREPARE Correct answer
- VIEW
Explanation: PREPARE is used against SQL injection.
3 Summary - Security and backup: match the terms
| Term | Meaning |
|---|---|
PREPARE |
prepare |
GRANT |
grant |
COPY TO |
backup |
PITR |
point-in-time |