Level 5 · Databases and Data Management · Course 5.2 SQL
Module 58: Database Administration
Goal: look after a database properly: control who can do what with users and roles, change the structure safely with migrations, and make backups you've actually proved you can restore.
You'll need: your crm.db and the SQL from Modules 55 to 57. (Users and roles need PostgreSQL; you'll practise them
in Module 60.)
Lessons
- 1Users, roles and permissions15–25 minutes✓
- 2Migrations15–25 minutes✓
- 3Backups15–25 minutes✓
- 4Restoring15–25 minutes✓
- 5Everyday care15–25 minutes✓
🛠️Module practice: Project B, an administered CRM database
- Roles and permissions planned in
admin.sql(run in Module 60). - The whole schema as numbered migration files; database rebuilt from them.
- Automated backup command and a 3-2-1 plan with RPO and RTO.
- A tested, timed restore with a written guide.
- An
admin.mdrunbook. Commit.
✅Module check
Explain in a few sentences, in your own words:
What does it take to look after a database responsibly?
Show a good answer
A good answer mentions: least-privilege roles (the app, migrations and reporting each with only the permissions they need, no everyday superuser); structure changes only through ordered, version-controlled migrations that are never edited after running and are made in safe steps on live systems; automated, encrypted backups following 3-2-1 with clear RPO and RTO; regular test restores into a separate database, timed and documented; plus monitoring, maintenance, careful handling of personal data, and written runbooks.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
