zoo = zoo id - animal id population = animal id – name of animal

advertisement
zoo = zoo id - animal id
population = animal id – name of animal - weight - kg eat - attributes
type specifics = name of animal - species (mammal ect.) - food id
food = food id - kg price - amount in store
We decided to use the four enitiy sets: we choosed Zoo as the ???????
The zoo has to own some animals so we made a relation between zoo and population called owns.
Population contains the information of all the individual animals and it has a relation to type specific that
can tell the general attributes of a certain animal type.
The specific animal type eats the same kind of food so we have a relation called eats from type specifics to
food.
Entity sets are made into tables. Relations are made by taking the key attributes of the entity sets next to it
and making a table of them. We have some special cases such as when we have a attribute on a relation or
we have a weak entity set, but we didn’t have that.
Our schema has more tables than what we made last week. By using an E/R model we get a very simple
method of designing databases.
The following queries less complicated
Does all the giraffes combined weigh more than all the elephants combined?
These have become more complicated:
Does the Zoo have more mammals, reptiles, marsupials, or birds?
How long can the lions feed on the remaining food in store?
Which animals are the most expensive to feed?
Download