1
ER-Diagram Examples
Ex. 1 - A Movie Domain
Domain Description:
• A movie has a title, a year and a length. Since
some movies have the same title, it takes a title
and a year to uniquely identify a movie.
• Some movies are remakes of others.
• A star has a name and an address. A star's
name uniquely identifies the star.
• A star can appear in any number of movies.
2
A Movie Domain
• Some movies have many stars and some have
none.
• A studio has a name and an address, and is
uniquely identified by its name.
• A star can belong to at most one studio.
• A studio can own any number of movies.
• A movie is always owned by at most one studio,
but some are not owned by any studio.
A Movie Domain
• A studio may or may not have a president, but
nobody can be a studio president without being
the president of some studio.
• Studio presidents are uniquely identified by their
name, but they also have an address.
• No one can be the president of more than one
studio.
• Stars and studio presidents are both examples
of movie people, but there are other types of
movie people as well.
• No star can be a studio president.
3
A Movie Domain
From the domain description we derive the entity
types and their attributes (including primary
keys):
• Entity types and their attributes:
– Movie
• title, year, length
– Star
• name, address
– Studio
• name, address
– Studio President
• name, address
– Movie People
• name, address
A Movie Domain
From the domain description we derive the
relationships between the entity types and
their cardinalities:
• Relationships:
– some movies are remakes of (exactly 1)
movie; each movie has (0 or more) remakes
– studios own (0 or more) movies; each movie
is owned by (at most 1) studio
– stars appear in (0 or more) movies; movies
have (0 or more) stars appearing in them
4
A Movie Domain
– stars belong to (at most 1) studio; studios
have (0 or more) stars belonging to them
– studio presidents are presidents of (exactly 1)
studio; studios have (at most 1) president
– stars and studio presidents are (disjoint bu