- Overview
- Learning outcomes
- Getting started
- Standard workflow
- Course structure
- Tooling and CI
- Contributing
- Design relational schemas using ER modeling and normalization principles.
- Implement schemas in MySQL Community Server 8.0.x.
- Apply constraints, transactions, and indexing for data integrity and performance.
- Practice iterative design changes with a final change request.
This repository contains an 8-week bachelor-level course on relational database design using MySQL 8.0 and MySQL Workbench. Each week includes a focused lab with scripts, exercises, and guidance.
- Translate requirements into ER models with correct cardinality and keys.
- Map ER models into normalized relational schemas.
- Write DDL with appropriate constraints and indexes.
- Detect and explain data anomalies and integrity violations.
- Validate schemas using repeatable integrity checks.
- Install MySQL Community Server 8.0.x and MySQL Workbench 8.0.x:
course/00_setup/00_mysql_install_windows.md
- Create a Workbench connection and user:
course/00_setup/01_workbench_connection.md
- Run scripts in Workbench:
course/00_setup/02_running_sql_scripts.md
- Start with Week 1:
course/01_week01_basics/README.md
Use the week-specific files for each lab. Examples:
Week 1 (denormalized):
shared/reset.sqlcourse/01_week01_basics/schema.sqlcourse/01_week01_basics/seed.sqlcourse/01_week01_basics/exercises.sql
Week 2 (ER modeling):
course/02_week02_er_modeling/requirements.mdcourse/02_week02_er_modeling/er_diagram_template.drawiocourse/02_week02_er_modeling/assumptions_template.mdcourse/02_week02_er_modeling/submission_checklist.md
Week 3 (mapping):
shared/reset.sqlcourse/03_week03_normalization/schema_v1.sqlcourse/03_week03_normalization/seed_v1.sqlcourse/03_week03_normalization/queries_v1.sqlcourse/03_week03_normalization/integrity_v1.sql
Week 4 (normalization):
course/04_week04_constraints/bad_schema.sqlcourse/04_week04_constraints/bad_seed.sqlcourse/04_week04_constraints/schema_v2.sqlcourse/04_week04_constraints/seed_v2.sqlcourse/04_week04_constraints/integrity_v2.sql
Week 5 (overlap triggers):
shared/reset.sqlcourse/03_week03_normalization/schema_v1.sqlcourse/03_week03_normalization/seed_v1.sqlcourse/05_week05_joins/rules.sqlcourse/05_week05_joins/test_negative_inserts.sqlcourse/05_week05_joins/integrity.sql
Week 6 (billing):
shared/reset.sqlcourse/03_week03_normalization/schema_v1.sqlcourse/03_week03_normalization/seed_v1.sqlcourse/06_week06_transactions/schema_billing.sqlcourse/06_week06_transactions/seed_billing.sqlcourse/06_week06_transactions/reporting_views.sqlcourse/06_week06_transactions/integrity.sql
Week 7 (indexes and EXPLAIN):
shared/reset.sqlcourse/03_week03_normalization/schema_v1.sqlcourse/03_week03_normalization/seed_v1.sqlcourse/06_week06_transactions/schema_billing.sqlcourse/06_week06_transactions/seed_billing.sqlcourse/07_week07_indexing/explain_tasks.sql(before indexes)course/07_week07_indexing/indexes.sqlcourse/07_week07_indexing/explain_tasks.sql(after indexes)
Week 8 (final change request):
course/08_week08_final_change_request/change_request_A_insurance.mdorcourse/08_week08_final_change_request/change_request_B_lab_tests.mdorcourse/08_week08_final_change_request/change_request_C_rooms.mdcourse/08_week08_final_change_request/migration_template.sqlcourse/08_week08_final_change_request/final_submission_checklist.md
course/00_setup/(install notes, tooling, and starter checks)shared/(shared scripts and assets)course/01_week01_basics/ ... course/08_week08_final_change_request/(weekly materials)
- Windows
- MySQL Community Server 8.0.x
- MySQL Workbench 8.0.x
Solutions are kept off the main branch. See docs/solutions_policy.md for the recommended workflow.
- SQL smoke tests run with MySQL 8 on GitHub Actions.
- Integrity checks must return 0 rows (see
shared/integrity_contract.md). - Structure validation ensures required folders exist.
- Use issue templates for week content and bug reports.
- Follow the run order in each week README and include integrity output in PRs.
- Keep student-facing content on main; put solutions on a
teacherbranch.
Use the root docker-compose.yml to start Mongo once for all labs.
docker compose up -d
py scripts\wait_for_mongo.py --host 127.0.0.1 --port 27017 --timeout 60See docs/RUNNING_LABS.md for the standard lab workflow and troubleshooting.