Session 12 – notes
During 'lecture 12' we just solved problems from the exam in March 2024, you can find solutions here, the things I scribbled is below:
Problem 1
The ER-model we came up with was:

It's pretty much the same as in the solutions which are linked above, and there you can see how we can implement the model.
Problem 2
Here I drew the following ER-diagram:

It's also very similar to the diagram in the solutions.
Problem 3
First we established some functional dependencies:

… and then we normalized a table into BCNF.
As I scribbled, I waved my arms and talked to explain why I used D -> EH in the first step, and F -> BG in the second step – on the exam, you're not supposed to waive your arms and talk, so you should write just a few words to explain (something like "I break out D -> EH, since it has a left hand side which is not a superkey").
BTW: I could have done it the other way around (i.e., first breaking out F -> BG), but each time we must chose a functional dependency which has a left hand side which isn't a superkey (when it's not a superkey, we can have several rows with the same value of the left side, and every time we get the same (repeated) values of the right hand side, and that's why we want to move it into a smaller table, where the left hand side will become a key, so we get no repetitions).
