In each of the below I drew the ER diagram and assume that you can read the cardinality and existence off of the diagram.

#### 1

The optional on the left could be left out. It is not stated in the problem. Assumption: A person does not have to be employed by a department.

#### 2

The optional on both sides could be left out. It is not stated in the problem. Assumptions: A department does not have to have a manager. A manager does not have to manage a department.

#### 3

The optional on both sides could be left out. It is not stated in the problem. Assumptions: An author does not have to write a book. A book does not have to have an author.

#### 4

The mandatory on the right could be left out. It is not stated in the problem. Assumption: A team must have at least one player. FYI: If you see this type of ER diagram, you can know that it is *not* implemented this way. Ask yourself: If there aren't any teams or players in a database, and I need to enter my first team, then I can't because I don't have any players for it yet. Similarly, if I need to enter my first player, then I can't because I don't have any teams for him/her yet. So, generally, you'll see an optional on the many side of the relationship.

#### 5

The optional on the right could be left out. It is not stated in the problem. Assumption: A lecturer does not have to teach any courses.

#### 6

The straight-forward way of describing this situation is the following.

But, you know, I don't really like the above. It doesn't capture what's really going on with a flight leg. A flight leg takes off from exactly one airport and lands at exactly one airport — why not make it so that the ER diagram represents the situation and emphasizes these facts?

To me, the above is a more natural representation of the situation, though the original description of the problem leads you to answer the problem similar to the first presentation.

#### 7

The existence information on each side is not stated in the problem. Assumptions: A product does not have to be on any purchase orders. A purchase order must have at least one product.

#### 8

Everything you need is in the problem statement.

Return to ER exercises.