This is an exercise. You don't have to show or hand in anything, but if you have any problems or questions, you are welcome to ask your teaching assistant.
There are solutions to the problems.
Note that Works at is a one-to-many relationship type, but Works on is a many-to-many relationship type. The entity types Department and Project each have two candidate keys.
There should not be an entity type called Company.
Remember:
As an example, here is the table Department:
Number | Name |
---|---|
10 | Data |
20 | Städning |
[Check the solution before you continue!] (But do solve it yourself before checking!)
[Check the solution!]
[Check the solution!]
[Check the solution!]
[Check the solution!]
[Check the solution!]
[Check the solution!]
(Hint: Use the SQL command alter table,
as in alter table Department add constraint ...)