Does anyone have any good scenarios for teaching relational databases and SQL? All the examples I can find are either trivial or have improbable domain constraints (like full name being unique).
I’m especially trying to find some good examples for normalisation: tables that don’t immediately fit 3NF and BCNF. At the moment I’m using a different problem for each level.
Of course, I’d also love good examples of badly designed databases, but it’s a bit distracting until the fundamentals have been mastered.
Thanks, some nice examples. I’ve marked the student/class one as the answer as I think it’s the best so far, but if anyone wants to contribute some more, please do.
I seem to remember student / class as being a classic, you can put grades in there as well to make it a bit more complex.
Student can atted many classes
Classes have many students
For eachclass a student attends they can have a grade
Initially you can do this in one table and denormalise to three.