CHAPTER 1

advertisement
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
CHAPTER 2
ENTITY-RELATIONSHIP DATA MODELING:
TOOLS AND TECHNIQUES

2.1
ANSWERS TO GROUP I QUESTIONS
Explain the word schema in your own words.
A schema is a description or representation of something that is real or imaginary. A schema is
similar to a model in that is describes the way something is constructed.
2.2
Name and explain the purpose of the three schemas in the ANSI/SPARC three schema
model.
The external schema, sometimes called the user view, is a representation of how users view the
database. For all but the simplest databases, an external schema portrays just a portion of the
database.
A conceptual schema is a complete logical view of the database that contains a description of all
the data and relationships in the database. The conceptual schema is logical, in that it is independent
of any particular means of storing the data.
An internal schema is a representation of a conceptual schema as physically stored using a
particular product and/or technique. The description of a set of tables, keys, foreign keys, indexes,
and other physical structures is an internal schema.
2.3
Explain a circumstance under which an organization could have three different external
schemas for the same conceptual schema.
At Lakeview, there might be one external schema for sales, one for marketing,
one for operations, and so forth. Or for a university a conceptual schema for a student database
could have an external schema for the president of the university, an external schema for a faculty
member, and an external schema for a student.
2.4
Describe how external schemas can be used to devise a conceptual schema.
External schemas are descriptions of the world as end users see the world. During the database
design process, designers collect information from end users and develop the different external
schemas for the different end user groups. These different external schemas are then combined into
one conceptual schema.
2.5
Why is it important not to confuse the conceptual schema with the internal schema?
We do not want to mix the logical view of the data with the physical view. If we do, we may find
that the characteristics of the DBMS will constrain and influence our thinking about the conceptual
model. In this case, we may miss something important in the user’s world—or, even worse, cause
the characteristics of a DBMS to constrain what the users can do. Such constraints allow the tail to
wag the dog. We do not want the characteristics of DBMS indexes to determine how salespeople
can sell!
2-1
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
2.6
What was the problem between Bruce and Zelda? Do you think they can ever agree on a
single way of viewing the data?
The problem, is that Bruce and Zelda have two very different perspectives of the same data. The
way they see the world and the way they interact with the world are different. They will probably
not agree on a single way of viewing the data. It is Conrad’s job to develop a conceptual schema
that can be used to represent both views.
2.7
What is the difference between the E-R model and the extended E-R model?
Subtypes were added to the E-R model to create the extended E-R model. Today, it is the extended
E-R model that most people mean when they use the term E-R model.
2.8
Why is IDEF1X important?
IDEF1X became a national standard and companies that sold data modeling tools had to conform to
IDEF1X in order to sell to the government. Such a large market could not be ignored, so most of
today’s popular data modeling products, such as ERWin and Visio, use IDEF1X. This means that
IDEF1X is the E-R version you are most likely to encounter, even more so than the extended E-R
model.
2.9
Why is UML important?
With the growing popularity of object-oriented systems development and object-oriented
programming, the use of UML is on the rise.
2.10 Define entity and give an example.
An entity is something that can be identified in the users’ work environment; something that the
users want to track. Example entities are EMPLOYEE Mary Doe, CUSTOMER 12345, SALESORDER 1000, SALESPERSON John Smith, and PRODUCT A4200.
2.11 Explain the difference between an entity class and an entity instance.
An entity class is a collection of entities and is described by the structure or format of the entities in
that class. An entity instance of an entity class is the representation of a particular entity, such as
CUSTOMER 12345; it is described by the values of attributes of the entity. There are usually many
instances of an entity in an entity class.
2.12 Define attribute and give examples for the entity you described in question 2.10.
Attributes describe the entity’s characteristics. Examples of attributes are EmployeeName,
DateOfHire, and JobSkillCode.
2.13 Explain what a composite identifier is and give an example.
Identifiers that consist of two or more attributes are called composite identifiers. Examples are
{AreaCode, LocalNumber}, {ProjectName, TaskName}, and {CityName and State}.
2.14 Which attribute defined in your answer to question 2.12 identifies the entity?
EmployeeName, DateOfHire,
2.15 Define relationship and give an example.
2-2
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
A relationship is an association between two or more entity classes. For example, assume you have
an entity class named Student and an entity class named Class. Students Enroll in a Class so you
would have a relationship named Enrolls In.
2.16 Explain the difference between a relationship class and a relationship instance.
Relationship classes are associations among entity classes, and relationship instances are
associations among entity instances.
2.17 Define degree of relationship. Give an example, other than the one in this text, of a
relationship greater than degree 2.
The number of entity classes in the relationship is the degree of the relationship. Assume entity
classes FACULTY, STUDENT, and MAJOR. Now assume a FACULTY is assigned to advise a
STUDENT for a given MAJOR.
2.18 List and give an example of the three types of binary relationships. Draw an E-R diagram
for each.
FACULTY
OFFICE
1:1
FACULTY-LOCATION
AUTO
REPAIR
1:N
AUTO-REPAIR
STUDENT
N:M
CLASS
STUDENT-SCHEDULE
2.19 Define the terms maximum cardinality and minimum cardinality.
Maximum cardinality is the maximum or larges number of entities that can occur on one side of
the relationship. Minimum cardinality is the minimum or smallest number of entities that can
occur on one side of the relationship.
2.20 Name and sketch the symbols used in the extended E-R model entity-relationship
diagrams for (a) entity, (b) relationship, (c) weak entity and its relationship, (d) recursive
relationship, and (e) subtype entity.
2-3
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
STUDENT
(a) Entity
1:N
(b) Relationship
1:N
STATE
(c) Weak entity and Relationship
CITY
EMPLOYEE
1:1
IS-MARRIED-TO
(d) Recursive Relationship
PERSON
m

STUDENT


FACULTY
STAFF
(e) Subtype
2.21 Give an example E-R diagram for the entities DEPARTMENT and EMPLOYEE, which
have a 1:N relationship. Assume that a DEPARTMENT does not need to have any
EMPLOYEE, but that every EMPLOYEE does have a DEPARTMENT.
DEPARTMENT
EMPLOYEE
1:N
EMPLOYEE-ASSIGNMENT
2.22 Give an example of a recursive relationship and show it in an E-R diagram.
Assume employees are allowed to marry employees. Not all employees are married to employees
but if an employee is married, they can one be married to one other employee.
EMPLOYEE
1:1
IS-MARRIED-TO
2.23 Define the term weak entity and give an example other than the one in this text.
Weak entities are those that cannot exist in the database unless another type of entity also exists in
the database. An entity that is not weak is called a strong entity. Assume that ROOMS cannot exist
unless they are in BUILDINGS.
BUILDING
1:N
ROOM
BUILDING-CONTAINS
2-4
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
2.24 Explain the ambiguity in the definition of the term weak entity. Explain how this term is
interpreted for the extended E-R model. Give examples other than those in this text of
each type of weak entity.
In a strict sense, if a weak entity is defined as any entity whose presence in the database depends on
another entity, then any entity that participates in a relationship having a minimum cardinality of 1
to a second entity is a weak entity. OFFICES must have a BUILDING, CITY must be in a STATE,
GRADE must belong to a STUDENT, REPAIR must be made to an AUTO.
2.25 Define the term ID-dependent entity and give an example other than one in this text.
An ID-dependent entity is one in which the identifier of one entity includes the identifier of
another entity. If you assume that a city can be in only one state but states may have cities with the same
name then to identify a city you need to know what state the city is in. For example, there is a Bristol, TN and
a Bristol VA.
1:N
STATE
CITY
CITY-IS-IN
2.26 Show how to use an ID-dependent entity to represent the multivalued attribute Skill in an
EMPLOYEE entity. Indicate both the maximum and minimum cardinalities on both sides of
the relationship. Use extended E-R symbols.
1:N
EMPLOYEE
SKILL
EMPLOYEE-SKILL
EMPLOYEE Contains:
Emp Id
Emp Name
Hire Date
Other attributes …
SKILL Contains:
Skill
2.27 Show how to use an ID-dependent entity to represent the multi-value composite attribute
Phone that contains the single-value attributes AreaCode, PhoneNumber. Assume that
Phone appears in an entity called SALESPERSON. Indicate both the maximum and
minimum cardinalities on both sides of the relationship. Use extended E-R symbols.
1:N
SALESPERSON
PHONE
SALESPERSON-PHONE
SALESPERSON Contains:
Sales Id
Sales Name
Sales Title
Other attributes …
PHONE Contains:
Area Code
Phone Number
2.28 Describe subtype entities and give an example other than those in this text.
2-5
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
A subtype entity is an entity that represents a special case of another entity, called its supertype. For
example, the entity STUDENT could be modeled to have subtypes of GRADUATE_STUDENT
and UNDERGRADUATE_STUDENT. Or, STUDENT could be modeled to have subtypes
BUSINESS_MAJOR, SCIENCE_MAJOR, LIBERAL_ARTS_MAJOR, and so forth.
The entity BUILDING could be modeled to have subtypes of CLASSROOM, OFFICE, or
RECREATIONAL. The entity CONGRESSPERSON could be modeled to have subtypes of
SENATOR or REPRESENTATIVE.
2.29 Explain the statement “In database processing, subtypes are used when values are
inappropriate for some attributes of some entity instances.” Show how this statement
applies to your answer to question 2.28.
By inappropriate we mean that the attribute does not apply to certain instances of the entity. For
example, if a building is an OFFICE building or a RECREATIONAL building then the attribute of
Number_of_Desks would not apply but it would apply if the building were a CLASSROOM
building. If a building were a RECREATIONAL building then the attribute Gym_Size would apply
but it would not apply to an OFFICE or a CLASSROOM building.
2.30 Explain the difference between a HAS-A relationship and an IS-A relationship, and give an
example of each.
The relationship between a supertype and its subtypes is sometimes called an IS-A relationship. Entities
with an IS-A relationship should have the same identifier because they represent different aspects
of the same thing. Entities with an HAS-A relationships represent aspects of different things and
thus have different identifiers. These relationships do not involve subtypes.
BUILDINGs with an identifier of Building Code and subtypes of CLASSROOM, OFFICE, and
RECREATIONAL have an IS-A relationship because all types of building are identified by the
building code. In essence, all subtypes IS-A BUILDING.
A binary relationship between ADVISOR and STUDENT would be a HAS-A relationship because
a STUDENT HAS-A ADVISOR, ADVSIOR is not a type of STUDENT.
2.31 Define primary key.
The Primary key as the principal unique identifier of the entity.
2.32 What is a foreign key and why are such keys inappropriate in a conceptual model?
A foreign key is the Primary key of one table placed in a second table to form a relationship. When
creating a conceptual model, one should focus on obtaining a model that supports all of the users’
views and needs for the data. One should not worry about foreign keys and the like. Such keys are
part of the internal schema, not the conceptual schema
2.33 What are non-identifying connection relationships?
Non-identifying connection relationships are 1:1 or 1:N relationships between two non-IDdependent (hence non-identifying) entities. Connection relationships are the same as what are called
HAS-A relationships in the extended E-R model.
2.34 Give an example of a non-identifying connection relationship.
EMPLOYEE
1:1
IS-MARRIED-TO
2-6
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
In the recursive relationship above the IS-MARRIED-TO relationship is a non-identifying
relationship.
2.35 Explain the meaning of a filled-in circle, a diamond, the letter P, the letter Z, and the
number 1 in an IDEF1X E-R diagram.
a filled-in circle: In IDEF1X, the default cardinality of a non-identifying connection relationship is
one-to-many, with a mandatory parent and an optional child. Such relationships are shown by a
dashed line with a filled circle by the child, and no other notation.
a diamond: If the parent is optional, a diamond is added to the line, adjacent to the parent.
the letter P: If the child is required, a P is placed near the circle, indicating that one or more child
entities are required (the P stands for positive, as in positive number).
the letter Z: a Z indicates that zero or one children are allowed.
the number 1: A 1 indicates that exactly one child is required;
2.36 What is the default cardinality of a non-identifying connection relationship?
The default cardinality of a non-identifying connection relationship is one-to-many, with a
mandatory parent and an optional child.
2.37 How do identifying connection relationships relate to the extended E-R model?
Identifying connection relationships are the same as ID-dependent relationships in the extended ER model.
2.38 What is the difference between a weak entity in the extended E-R model and an identifying
connection relationship in the IDEF1X model?
In the IDEF1X model, rounded corners signify ID-dependent entities only. There is no way in
IDEF1X to document a weak entity that is not an ID-dependent entity. Therefore, and weak entity
in the IDE1X model is assumed to have an identifying relationship.
2.39 How does the IDEF1X model represent a weak entity that is not ID-dependent?
IDEF1X allows for weak entities that are not identifying, but provides no special notation for such
entities. The minimum cardinality for the parent in such relationships is 1, but no other means exists
for documenting the fact that they are logically dependent on their parent.
2.40 How are N:M relationships represented in an IDEF1X model?
A many-to-many relationship relationship is simply a Non-specific relationship. Non-specific
relationships are shown with a filled-in circle on each end of the solid relationship line. In IDEF1X,
there is no way to set minimum cardinalities of a non-specific relationship.
2.41 Make the argument that N:M relationships do not exist. Give examples other than the ones
in this text in your answer.
N:M relationships do not really exist because there is no conceptual data to represent them. They
only appear to exist because something has been left out of the model. Such relationships have no
direct expression in the relational model. During implementation, they must be converted to two
1:N relationships therefore they do not exist as one N:M relationship but as two 1:N relationships.
RIVERS flow through many STATES and STATES and many RIVERS flowing through them.
This is true even if a model does not allow you to show the relationship.
2-7
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
2.42 Make the argument that N:M relationships do exist. Give examples other than the ones in
this text in your answer.
One should be able to fully document an M:N relationship, including minimum cardinalities, in the
conceptual model. What happens to that relationship later in designing the internal schema should
not be a factor in conceptual design. A Passenger can be on many Flights and a Flight can have
many Passengers. However, for a Passenger to board a Flight they must have a Ticket fro each
flight. This makes a 1:N relationship between Ticket and Passenger, and a 1:N relationship between
Ticket and a Flight.
2.43 Of the two arguments in your answers to question 2.41 and 2.42, which do you believe?
I would argue that N:M relationships do exist. First they exist in the user’s view of their world.
Secondly, what happens to that relationship later in designing the internal schema should not be a
factor in conceptual design.
2.44 Why? Explain the terms generic entity, category entity, and categorization cluster. Give an
example of each.
A generic entity is similar to a super type in the E-R model. A STUDENT would be generic entity
A category entity is similar to a subtype. If a STUDENT could be an UNDERGRADUATESTUDENT, GRADUATE-STUDENT, or a SPECIAL-STUDENT these would be category entities.
A categorization cluster is a group of category entities. In the example above the collection of
UNDERGRADUATE-STUDENT, GRADUATE-STUDENT, and SPECIAL-STUDENT entities
would be a categorization cluster.
2.45 What is the role of a discriminator in a category relationship?
A discriminator is an attribute of the generic entity that indicates the type of the category entity the
generic entity is.
2.46 Explain the difference between a complete category cluster and an incomplete category
cluster.
In a complete category cluster, every possible type of category for the cluster is shown. Complete
category clusters are denoted by two horizontal lines, with a gap in-between.
In an incomplete category cluster, there may be types of categories that are not shown.
2.47 Explain why the Z notation with complete category clusters is puzzling.
The use of the Z notation may appear to be puzzling, if not wrong. As stated, categories in a cluster
are mutually exclusive. Thus, after an entity has a relationship to one category entity, the cardinality
of the relationship to the other entities in that cluster is zero. Additionally, the Z on the line between
the generic entity and the cluster symbol indicates that a generic entity may or may not have a
category entity. For complete clusters, the Z should be a 1 in some cases, indicating that the generic
entity must have a relationship to a category entity. There is no way to specify a 1 in the IDEF1X
model for this case.
2.48 Explain the circumstances under which an entity instance may have a relation-ship to two
or more category entity instances.
This can occur only is the category entities are in different category clusters. For example a
STUDENT may have a relationship to a GRATUATE-STUDENT category entity in one cluster
and a relationship to OFF-CAMPUS-STUDENT in a different cluster.
2-8
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
2.49 What are the differences between a categorization relationship in the IDEF1X model and
subtypes/supertypes in the extended E-R model?
The IDEF1X model adds structure to the generalization/subtype relationships in the extended E-R
model. By further defining these concepts, the IDEF1X model makes them more meaningful and
hence more useful.
2.50 Explain the normal way that relationships are named.
Normally, a name consists of a verb or verb phrase expressed from the standpoint of the parent in
the relationship, followed by a slash, and followed by the verb phrase expressed from the
standpoint of the child. Normally, the verb phrase from the child’s view is the passive form of the verb
phrase from the parent’s view.
2.51 When are relationship names particularly useful?
They can be helpful, however, when the relationship between two entities is ambiguous. In Figure
2-25, there are two relationships between CUSTOMER and SALE. One relationship is used to
document that a customer can buy something; a second is used to document that a customer can sell
something.
2.52 What is a domain?
A domain is a named set of values that an attribute can have. A domain can consist of a specific list
of values, or it can be defined more generally for example, as a set of strings of maximum length
50.
2.53 Explain two ways that domains reduce ambiguity.
Domains can reduce ambiguity when two attributes have the same name but represent different
things. For example, different entities may have an attribute of Tax. If this were Sales Tax for one
attribute and Income Tax for the other attribute, domains could be defined to distinguish between
the two.
Furthermore, named domains eliminate ambiguity from attributes whose values look similar, but
are not the same.
2.54 Describe how domains are practically useful.
One way domains become useful is to assign like attributes to the same domain. For example, if
you create a domain for Dates and the domain used a format of MM-DD-YY, all dates assigned to
that domain would be forced to use that format. If you decided that the formats for dates need the
four-digit year you could change the domain and all dates would now use the new format.
Another practical use for domains is to assess whether two attributes that are named differently are
referring to the same thing. They would be if they have the same domain.
2.55 Define base domain.
A base domain is a domain having a data type and possibly a value list or range definition.
2.56 Define type domain.
A type domain is a subset of a base domain or a subset of another type domain. Type domains
allow the definition of domain hierarchies that can be used for greater specificity.
2-9
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques

ANSWERS TO GROUP II QUESTIONS
Use the STUDENT ACTIVITY IDEF1X diagram in Figure 2-32 to answer the following questions:
2.57 Consider the relationship between STUDENT and EQUIPMENT:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A STUDENT can have many EQUIPMENTs but an
EQUIMENT can belong to only one STUDENT.
C. What are the minimum cardinalities?
The minimum cardinalities are zero on both sides. An EQUIPMENT does not require a
STUDENT as indicated by the diamond. A STUDENT is not required to have an
EQUIPMENT indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
No changes. Since Students are no required to take course they would not be required to be
assigned equipment. It is also possible that a course does not have students so the equipment
may not be assigned to a student.
E. Give an appropriate name for this relationship.
Assigned/Assigned To
2.58 Consider the relationship between EQUIPMENT and COURSE:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A COURSE can have many EQUIPMENTs but an
EQUIMENT can belong to only one COURSE.
C. What are the minimum cardinalities?
The minimum cardinalities are zero AND 1. An EQUIPMENT must be assigned to a COURSE
(default cardinality). A COURSE is not required to have EQUIPMENT indicated by using the
default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
No changes.
E. Give an appropriate name for this relationship.
Uses/Used by
2-10
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
2.59 In Figure 2-32, COURSE describes a course such as Beginning Kayaking or Intermediate
Scuba; CLASS describes a particular offering of a course, such as the class Beginning
Kayaking offered on January 7, 2003. For the relationship between COURSE and CLASS:
A. What type is this relationship? Is this the correct type for this relationship?
Identifying Connection Relationships since the key of the class would include the key of the
course (course name). YES, the correct type of relationship is shown.
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A COURSE can have many CLASSes but a CLASS can
belong to only one COURSE.
C. What are the minimum cardinalities?
The minimum cardinalities are zero AND 1. A CLASS must be assigned to a COURSE (default
cardinality). A COURSE is not required to have CLASSes indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
No changes.
E. Give an appropriate name for this relationship.
Offers/Offered By
2.60 Consider the relationship between CLASS_FEE and CLASS:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A CLASS can have many CLASS_FEEs but a
CLASS_FEE can belong to only one CLASS.
C. What are the minimum cardinalities?
The minimum cardinalities are zero AND 1. A CLASS_FEE must be assigned to a CLASS
(default cardinality). A CLASS is not required to have CLASS_FEE indicated by using the
default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
No changes. Students are not required to have classes so a class may not have a fee. If a student
pays a fee it must be assigned to a class.
E. Give an appropriate name for this relationship.
Pays/Charges
2.61 Consider the relationship between CLASS_FEE and STUDENT:
A. What type is this relationship?
2-11
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A STUDENT can pay many CLASS_FEEs but a
CLASS_FEE can belong to only one CLASS.
C. What are the minimum cardinalities?
The minimum cardinalities are zero and zero. A CLASS_FEE is not required to be assigned to
a CLASS as indicated by the diamond. A COURSE is not required to have a CLASS_FEE
indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
Change the minimum cardinality to STUDENT to the default (required) by removing the
diamond. If a CLASS_FEE does not require a STUDENT, who pays the fee?.
E. Give an appropriate name for this relationship.
Pays/Paid By
2.62 Consider the relationship between STUDENT and CLUB:
A. What type is this relationship?
Non-specific Relationship
B. Describe a possible new entity that would change this relationship into two nonidentifying connection relationships. Specify appropriate cardinalities for your new
relationships.
MEMBERSHIP: This entity would include attributes such as Member_Id, Date_joined, and
Dues_Paid. The cardinalities would be 1:M between CLUB and MEMBERSHIP (Clubs can
have zero to many Memberships but a Membership must be for a single Club). 1:N between
STUDENT and MEMBERSHIP (Students can have zero to many Memberships but each
Membership must belong to exactly one Student.
C. Do you think the design in your answer to question B is a better design than the
relationship shown in this figure?
YES, there are attributes that do not belong to either the CLUB or the STUDENT (Member_Id,
Date_Joined, and Dues_Paid. This design allows you to show a cleared design.
2.63 Add a new entity called INSTRUCTOR. Create a new relationship between INSTRUCTOR
and COURSE and a new relationship between INSTRUCTOR and EQUIPMENT.
A. Justify the type of relationships you have chosen.
Non-Identifying Connection Relationship. Both relationships would be 1:N. They are nonidentifying because Instructor, Equipment, and Course have their own identifiers.
Note that these relationships would probably make the relationship between
EQUIPMENT and COURSE unnecessary.
B. Specify cardinalities for your new relationships.
2-12
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
Both relationships would be 1:N. An Instructor could teach from zero to many Courses but a
Course must have one Instructor. An instructor may have from zero to many Equipments (zero
if they do not teach a course, many if they teach at least one course) but Equipment must be
assigned to only one Instructor since the Equipment must be assigned to one Course and the
Course must have one Instructor.
C. Name your new relationships.
Between INSTRUCTOR and EQUIPMENT: Uses-Used By
Between INSTRUCTOR and COURSE: Teaches-Taught By
D. Redraw the diagram in Figure 2-32 to show your new relationships. Place all
cardinalities from your answers to questions 2.57 to 2.62 on this diagram.
CLUB
EQUIPMENT
STUDENT
INSTRUCTOR
CLASS_FEE
COURSE
CLASS
2.64 Modify your answer in question 2.63 to make INSTRUCTOR and CLUB_OFFICER
category entities of STUDENT.
A. Should you use a complete or an incomplete category cluster? Explain your answer.
Incomplete Category Cluster. Students are not required to members of a Club so there will be
Students that are not Club_Officers. We must assume that not all Students are Instructors to
there will be Students that are neither Instructors nor Club_Officers.
B. Name and describe an attribute that could be used as a discriminator for this category
cluster.
Student_Status. This would be a code to indicate that the Student is an Officer (value O) or
Instructor (value I). If the Student is neither the value would be null.
C. Redraw the diagram in your answer to question 2.63 to show your new relationships.
2-13
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
CLUB
CLASS_FEE
STUDENT
CLASS
Z
Z
CLUB_OFFICER
Z
INSTRUCTOR
EQUIPMENT
COURSE
Use the EMPLOYEE TRIP IDEF1X diagram in Figure 2-33 to answer the following questions:
2.65 Consider the relationship between EMLOYEE and TRIP:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. An EMPLOYEE can have many TRIPs but a TRIP can
belong to only one EMPLOYEE.
C. What are the minimum cardinalities?
The minimum cardinalities are zero and zero. A TRIP is not required be assigned to an
EMPLOYEE as indicated by the diamond. AN EMPLOYEE is not required to have TRIP,
indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
Change the minimum cardinality at the Employee to mandatory by removing the diamond. If
the Trip does not belong to an Employee, who is taking the trip?
E. Give an appropriate name for this relationship.
Takes/Taken By
2.66 Consider the relationship between TRIP and AIRLINE_RESERVATION:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A TRIP can require many AIRLINE_RESERVATIONSs
but an AIRLINE_RESERVATION can belong to only one TRIP.
C. What are the minimum cardinalities?
2-14
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
The minimum cardinalities are zero and zero. An AIRLINE_RESERVATION does not need to
be assigned to a TRIP as indicated by the diamond. A TRIP is not required to have an
AIRLINE_RESERVATION indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
Change the minimum cardinality at the Trip to mandatory by removing the diamond. If the
Airline Reservation does not belong to a Trip, why do we even have a reservation?
E. Give an appropriate name for this relationship.
Requires/Reserved For
2.67 Consider the relationship between TRIP and CAR_RESERVATION:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A TRIP can require many AIRLINE_RESERVATIONSs
but an AIRLINE_RESERVATION can belong to only one TRIP.
C. What are the minimum cardinalities?
The minimum cardinalities are zero and zero. An AIRLINE_RESERVATION does not need to
be assigned to a TRIP as indicated by the diamond. A TRIP is not required to have an
AIRLINE_RESERVATION indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
Change the minimum cardinality at the Trip to mandatory by removing the diamond. If the
Airline Reservation does not belong to a Trip, why do we even have a reservation?
E. Give an appropriate name for this relationship.
Requires/Reserved For
2.68 Consider the relationship between TRIP and HOTEL_RESERVATION:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A TRIP can require many HOTEL_RESERVATIONSs
but an HOTEL_RESERVATION can belong to only one TRIP.
C. What are the minimum cardinalities?
The minimum cardinalities are zero and 1. An HOTEL_RESERVATION must be assigned to a
TRIP as indicated by the default. A TRIP is not required to have a HOTEL_RESERVATION,
indicated by using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
2-15
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
No Changes
E. Give an appropriate name for this relationship.
May Require/Reserved For
2.69 Consider the relationships among AIRLINE_RESERVATION, E_TICKET, and
PAPER_TICKET:
A. What type is this relationship?
Complete Categorization Relationship
B. What are the maximum cardinalities?
An Airline_Reservation must be either an E_Ticket or a Paper_Ticket but not both. Each
E_ticket or Paper_Ticket can be only one Airline_Reservation. This gives a maximum
cardinality of 1:1.
C. What are the minimum cardinalities?
Since all E_Tickets must be Airline_Reservations but Airline_Reservations are not required to
be E_Tickets, the minimum cardinality here is 1 and zero. Since all Paper_Tickets must be
Airline_Reservations but Airline_Reservations are not required to be Paper_Tickets, the
minimum cardinality here is 1 and zero. Note that since this is a complete Categorization
Relationship, the Generic entity Airline_Reservation must have one E_Ticket or one
Paper_Ticket so the minimum cardinality between the Airline_Reservation and the category
cluster is 1 and 1.
D. Is this a complete or an incomplete category cluster? Should it be a different type of
category cluster?
It is a complete category cluster. I would argue that this is appropriate. I can think of no other
type of ticket required by an airline.
E. Give an example discriminator for this relationship.
Ticket_Type: This would be a code carrying one of two values, E for E_Ticket and P for
Paper_Ticket.
2.70 Add a new entity called EXPENSE_REPORT. Create a new relationship between
EMPLOYEE and EXPENSE_REPORT and a new relationship between TRIP and
EXPENSE_REPORT.
A. Justify the type of relationships you have chosen.
Both relationships are Non-Identifying Connection Relationships. Each instance of the
relationship will be for an expense item for and EMPLOYYE on a TRIP. It is not an Identifying
Connection Relationship because each expense item would have its own identifier. It is not a
Non-Specific Relationship because it is not a many-to-many relationship. It is not a
Categorization Relationship because Expense Reports are not Employees or Trips.
B. Specify cardinalities for your new relationships.
2-16
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
The relationship between Employee and Expense_Report is 1:N. An Employee may have zero
instances of Expense_Report since they may not take Trips or they may have many, especially
is they take more than one Trip. An Expense_Report instance must belong to an Employee and
only one Employee.
The relationship between Trip and Expense_Report is also a 1:N. A Trip may have zero
instances of Expense_Report since they are not required to have any reservations or they may
have many since they can have both airline and hotel reservations. An Expense_Report instance
must belong to a Trip and only one Trip.
C. Name your new relationships.
Employee and Expense_Report: Submits-Submitted By
Trip and Expense_Report: Charges-Charged To
D. Redraw the diagram in Figure 2-33 to show your new relationships.
EMPLOYEE
EXPENSE_REPORT
TRIP
HOTEL_RESERVATION
E_TICKET
CAR_RESERVATION
AIRLINE_RESERVATION
PAPER_TICKET
2.71 Modify your answer in question 2.70 to make BUSINESS and PERSONAL category
entities of TRIP. Assume that there can be no relationship between EXPENSE_REPORT
and PERSONAL.
A. Should you use a complete or an incomplete category cluster?
Complete. Expense_Report instances should be either Business or Personnal.
B. Name and describe an attribute that could be used as a discriminator for this category
cluster.
Expense_Category. The value would be P for Personnal and B for Business.
C. Redraw the diagram in your answer to question 2.70 to show your new relationships.
2-17
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
EMPLOYEE
TRIP
HOTEL_RESERVATION
AIRLINE_RESERVATION
EXPENSE_REPORT
CAR_RESERVATION
Z
E_TICKET
PAPER_TICKET
Z
Z
BUSINESS
PERSONNAL
2.72 Consider the relationship between FISH and OBSERVATION:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
The maximum cardinalities are 1:N. A FISH can require many OBSERVATIONs but an
OBSERVATION can belong to only one FISH.
C. What are the minimum cardinalities?
The minimum cardinalities are zero and zero. An OBSERVATION may not be for a FISH
indicated by the diamond. A FISH is not required to have an OBSERVATION, indicated by
using the default.
D. Describe any cardinality changes that you think should be made. Justify your changes.
Change the minimum cardinality to the default of one (remove the diamond). Based upon
Figure 2-4 of the text, no observation is recorded unless some type of fish is counted.
E. Give an appropriate name for this relationship.
Found During/Observed For
2.73 Consider the relationship between RIVER and OBSERVATION:
A. What type is this relationship?
Non-Identifying Connection Relationship
B. What are the maximum cardinalities?
2-18
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
The maximum cardinalities are 1:N. A RIVER can require many OBSERVATIONs but an
OBSERVATION can belong to only one RIVER.
C. What are the minimum cardinalities?
The minimum cardinalities are one and one. An OBSERVATION must be for a RIVER
indicated by using the default. A RIVER is required to have at least one OBSERVATION,
indicated by using the P for positive number.
D. Describe any cardinality changes that you think should be made. Justify your changes.
No Changes
E. Give an appropriate name for this relationship.
Location of/Recorded at
2.74 Add a new entity called RIVER_SITE as a child entity in an identifying connection
relationship to RIVER. Remove the relationship between RIVER and OBSERVATION and
place a new relationship between OBSERVATION and RIVER_SITE.
A. Define and justify cardinalities between RIVER and RIVER_SITE.
This should be a 1:N relationship. Each River could have several Observation_Sites and an
Observation_Site must be located on a River since the relationship is an identifying connection
relationship.
B. Define and justify cardinalities between RIVER_SITE and OBSERVATION.
This relationship is also a 1:N relationship. Many Observations can be made at a site and all
observations must be made at one site.
C. Name your new relationships.
River and Observation_Site: Has/Location Of
Observation and Observation_Site: Records/Made at
D. Redraw Figure 2-34 given your new design.
FISH
RIVER
OBSERVATION
RIVER_SITE
2.75 Add a new entity called OBSERVER to your answer to question 2.74. Create a
relationship between OBSERVATION and OBSERVER. Also, add a category cluster to
OBSERVER with two categories: PROFESSIONAL and VOLUNTEER.
A. What type of relationship is appropriate? Justify your answer.
2-19
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
The relationship between OSERVER and OBSERVATION is a non-identifying connection
relationship. It is not an identifying connection relationship because OBSERVATION would
have is own independent identifier. It is not a non-specific relationship because it is not a manyto-many relationship. It is not a categorization relationship because Observations are not a type
of Observer.
B. Define and justify cardinalities between OBSERVER and OBSERVATION. Name this
relationship.
Makes-Made By; Cardinalities are 1:N. An Observation must be made by someone (an
Observer) and each Observation is made by a single Observer (Bruce or Zelda). An Observer
and make many Observations or it may be possible that a new Observer made make zero
observations.
C. What type of category cluster is appropriate?
Complete: This does assume that all observers will either be Professional or Volunteers.
D. Redraw your answer to question 2.74 given your new design.
FISH
OBSERVATION
RIVER_SITE
RIVER
OBSERVER
VOLUNTEER
PROFESSIONAL
2.76 Create a new entity called CLASS. Construct a relationship between VOLUNTEER and
CLASS.
A. What type of relationship is appropriate? Justify your answer.
It is not a non-specific relationship because it is not a many-to-many relationship. A Volunteer
may take many classes and a Class may be taken by many different Volunteers. It is not a nonidentifying connection relationship because it is not a 1:N relationship. It is not an identifying
connection relationship because Class would have is own independent identifier. It is not a
categorization relationship because Classes are not a type of Volunteer.
B. Redraw your answer to question 2.75 given your new relationship.
2-20
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
FISH
OBSERVATION
RIVER_SITE
RIVER
OBSERVER
VOLUNTEER
PROFESSIONAL
CLASS
C. Create another entity called CLASS_OFFERING, which represents a particular offering
of a particular class. Add and remove relationships as appropriate. For each new
relationship, give the type, give the cardinalities, and name the relationship.
The relationship between Class and Class_Offering would be an identifying connection
relationship with a one to many cardinality. Each Class may have many offerings but any
offering is of a single class. The relationship would be named Has-Offered For.
The original relationship between Volunteer and Class is replaced by a relationship between
Volunteer and Class_Offering. A Volunteer would attend an offering of a class, not all
offerings of a class. The relationship would still be a non-specific relationship because it is a
many-to-many. The relationship would be name Attends-Attended By.
D. Redraw your answer to question 2.75 given your new design.
FISH
OBSERVATION
RIVER_SITE
OBSERVER
VOLUNTEER
PROFESSIONAL
RIVER
CLASS
CLASS_OFFERING
2.77 The Public Affairs Office at Highline University receives requests for speakers on
particular topics. To be able to respond to such request, that office wants to build a
database. In particular, it wants to keep track of topics, speakers, speeches, and
organizations to which someone from Highline has spoken.
A. Make a list of possible entities for the Speaker database.
TOPICS
SPEAKERS
SPEECHES
ORGANIZATIONS
2-21
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
B. Create an IDEF1X E-R diagram showing only entities (like Figure 2-34). Assume that
there is an M:N relationship between SPEAKER and TOPIC.
SPEECHES
SPEAKERS
TOPICS
ORGANIZATIONS
C. For each relationship in your diagram, specify the relationship type, and the minimum
and maximum cardinality on both parent and child. Name each relationship.
SPEAKER and TOPIC: This would be a non-specific relationship because it is a many-to-many
relationship.
SPEAKER and SPEECHES
SPEECHES and ORGAINZATIONS
D. Repeat questions B and C, but add an entity to your diagram so that there will be no
N:M relationship.
E. Do you prefer the design in question B and C or the design in question D? Justify your
preference.
2.78 The Metropolitan Housing Agency (MHA) is a non-profit organization that advocates the
development and improvement of low-income housing. The MHA operates in a metropolitan area
of approximately 2.2 million people in a midwestern city. The MHA maintains data about the
location, availability, and condition of low-income housing in 11 different census tracts in the
metropolitan area. Within the boundaries of these tracts are approximately 250 different buildings
that provide low-income housing. On average, each building contains 25 apartments or other units.
The MHA keeps data about each census tract, including geographic boundaries, median income of
the population, elected officials, principal businesses, principal investors involved in attributes in
that tract, and other demographic and economic data. It also maintains a limited amount of data
about crime. For each building, the MHA stores the name, address, size, owner(s)’s name and
address, mortgagor(s)’s name and address, renovations and repairs, and avail-ability of facilities for
handicapped people. In addition, the MHA keeps a list of each of the units within each building,
including the type of unit, size, number of bedrooms, number of baths, kitchen and dining facilities,
location in the building, and any special remarks. The MHA wants to maintain data regarding the
average occupancy rates for each unit, but to date it has been unable to collect or store such data.
The MHA does, however, keep data about whether a given unit is occupied.
The MHA serves as an information clearinghouse and offers three basic ser-vices. First, it works
with politicians, lobbyists, and advocacy groups to support legislation that encourages the
development of low-income housing through tax incentives, developmental zoning preferences, and
other legislative inducements. To accomplish this, the MHA provides information about lowincome housing to state, county, and city governments. Second, through speeches, seminars,
displays at conventions, and other public relations activities, the MHA officials strive to raise the
community’s consciousness about the need for low-income housing. Finally, the MHA provides
2-22
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
information about the availability of low-income housing to other agencies that work with the lowincome and homeless populations.
A. Make a list of possible entities for a database to support MHA’s information needs.
Elected Officials
Principle Businesses
Principle Investors
Census Tract
Building
Apartment
Crime
B. Construct an IDEF1X entity-relationships diagram for the entities in question A.
OFFICIAL
BUSINESS
INVESTOR
Is_In/Contains
Invests_In/Has
Represents/Represented by
CENSUS TRACT
CRIME
Has/Is_committed_In
Has/Is_located_In
BUILDING
Contains/Is_In
UNIT
C. Name each relationship and ensure that you have correctly defined the minimum and
maximum cardinalities.
These are shown on the diagram above.
Note: You may find that as you answer question B, you will add, remove, or change some of the
entities in your answer to question A. This is normal and very typical of the data modeling
process. Just keep working back and forth until you have an IDEF1X E-R diagram that you
believe is correct.

ANSWERS TO FIREDUP PROJECT QUESTIONS
Consider the situation of FiredUp, which was discussed at the end of Chapter 1. Assume that FiredUp has
now developed a line of three different stoves: FiredNow, FiredAlways, and FiredAtCamp. Further,
assume that the owners are selling spare parts for each of their stoves and that they also are making stove
repairs. Some repairs are at no charge because they are within the stove warranty period; other repairs are
2-23
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
made at a charge for parts only; and still others are made for parts and labor. FiredUp wants to keep track
of all of these data. When asked for further details, the owners made the following list:
CUSTOMER: Name, StreetAddress, ApartmentNumber, City, State/Province, Zip/PostalCode,
Country, EmailAddress, PhoneNumber
STOVE: SerialNumber, Type, ManufactureDate, InspectorInitials
INVOICE: InvoiceNumber, Date, Customer with a list of items and prices that were sold,
TotalPrice
REPAIR: RepairNumber, Customer, Stove, Description with a list of items that were used in the
repair and the charge for them (if any), TotalAmount of the repair
PART: Number, Description, Cost, SalesPrice
A. Create an extended E-R entity-relationship diagram of a database for FiredUp. Set the
minimum and maximum cardinality of the relationships among entities, as you think is
appropriate. Explain your rationale for each cardinality value. Use weak entities as
appropriate. Do not use subtypes. Name any ID-dependent entities, if any.
1:N
CUSTOMER
N:1
1:N
INVOICE
REPAIR
1:N
STOVE
N:M
PART
CUSTOMER may have from zero to many INVOICEs. If they ordered long ago, the invoice
may no longer exist. They could have multiple invoices if they have ordered more than one
stove at different times. An INVOICE must belong to a CUSTOMER and cannot belong to
more than one customer.
An INVOICE may be for more than one STOVE but it must be for at least one stove. A
STOVE may not be on an INVOICE (it could be in for repair) but it cannot be on more than
one invoice (cannot be sold to two different people).
A REPAIR must be made for a CUSTOMER and not more than one customer. A Customer
may have more than one stove in for repair or they may not have any stoves in for repair.
PARTs can be used on more than one REPAIR but do not have to be used on any repair. A
repair may require multiple parts or may not require any parts.
A STOVE may be REPAIRED more than once or it may never be repaired. A repair must be
made on exactly one stove.
B. Modify the entity-relationship diagram in your answer to question A by representing
INVOICE and REPAIR with appropriate subtypes. Under what circumstances is this
design better than the one in your answer to question A?
This model is much more restrictive than the one in A. I would probably use this model only if
a customer were not allowed to purchase a stove and parts at the same time.
2-24
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
1:N
CUSTOMER
REPAIR
N:M
1
1:N
PART
N:M
INVOICE

WARRENTY


PARTS_ONLY
PARTS&LABOR
1


STOVE_INV
PARTS_INV
N:1
1:N
STOVE
C. Transform your answer to question B to an IDEF1X diagram. Make changes to
subtypes and weak entity relationships as appropriate.
CUSTOMER
REPAIR
PART
Z
Z
Z
WARRENTY
INVOICE
Z
STOVE_INV
PARTS_ONLY
PARTS&LABOR
Z
PARTS_INV
STOVE
D. Suppose that FiredUp wants to keep track of home, fax, and cell phone numbers as
well as multiple e-mail addresses for each of its customers. Modify your model in A to
allow for multiple values of PhoneNumber and EmailAddress. You can use either the
extended E-R diagram or the IDEF1X diagram, depending on which you prefer.
2-25
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
PHONE
N:1
EMAIL_ADDRESS
N:1
1:N
CUSTOMER
1:N
INVOICE
REPAIR
N:1
1:N
N:M
STOVE
PART
E. Suppose that FiredUp develops different versions of the same stove product. Thus, it
develops a FiredNow Version 1 and a FiredNow Version 2, and so on. Although
FiredUp could consider each version of a stove to be a new product, it does not want
to do that. Modify your entity-relationship diagram from question D as necessary to
account for this situation. You can use either extended E-R or IDEF1X format,
depending on which you prefer.
PHONE
N:1
EMAIL_ADDRESS
N:1
1:N
CUSTOMER
N:1
1:N
INVOICE
REPAIR
1:N
N:M
STOVE
PART
1

VERSION1

VERSION2
2-26

VERSION3
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques

ANSWERS TO TWIGS TREE TRIMMING SERVICE
Consider the situation of Samantha Green, who owns and operates Twigs Tree Trimming Service,
described at the end of Chapter 1. Although many of her jobs are one-time operations to remove a tree or
stump, others are recurring: trimming a tree or groups of trees every year or every other year. When
business is slow, she calls former clients to remind them of her service and of the need to trim their trees
on a regular basis.
Samantha grinds the branches and trunks that she cuts into small chips using a chip grinder that she tows
behind her truck. The chips are thrown into the back of her truck as they are ground. For years, Samantha
took these chips to the recycling center, but recently she discovered that she could sell these chips to
nurseries and organizations for use as mulch. Even more recently, she discovered that some of her own
tree-trimming customers want to buy chips as well. (Yes, it is possible that customers could pay her to cut
a tree and grind the branches, and repurchase their own chips as mulch some time later. Samantha’s
response to that was, “I love America!”)
Samantha keeps the following data:
OWNER OwnerName, Phone, Street, City, State, Zip
RECURRING_SERVICE MonthsBetweenService, Description, ServiceFee
SERVICE DateOfService, Description, AmountBilled, AmountPaid, DateOfPayment
CHIP_DELIVERY CustomerName, Phone, Street, City State, Zip, DateDelivered, LoadSize,
AmountBilled, AmountPaid
A. To begin, assume that all jobs are recurring. Create an IDEF1X E-R diagram for
OWNER, RECURRING_SERVICE, and SERVICE. Model the relationship between
RECURRING_SERVICE and SERVICE as an ID-dependent entity. State the type of
all relationships, give the minimum and maximum cardinalities, and name each
relationship.
SERVICE
OWNER
Phone
OwnerName
Street
City
State
Zip
RECURRING SERVICE
Description
MonthsBetweenService
ServiceFee
DateOfService
Description
AmountBilled
AmountPaid
DateOfPayment
Owner and Recurring Service: Non-Identifying connection relationship, Owner may have from
zero to many Recurring services, Recurring service must belong to exactly one Owner,
HasPerformed/PerformedFor
Recurring Service and Service: Identifying connection relationship, Recurring Service can have
from one to many Services, Service must belong at exactly one Recurring Service,
PerformedLast/BelongsTo
B. Now, assume that no jobs are recurring. That is, remove RECURRING_SERVICE and
model SERVICE as a strong entity. Create an IDEF1X model: state the type of all
relationships, give the cardinalities, and name each relationship.
2-27
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
OWNER
SERVICE
Phone
OwnerName
Street
City
State
Zip
DateOfService
Description
AmountBilled
AmountPaid
DateOfPayment
Owner and Service: Non-Identifying connection relationship, Owner may have from zero to
many Services, Service must belong to exactly one Owner, HasPerformed/PerformedFor
C. Combine your answers to questions A and B by naming the entity for services that are
recurring as RECURRING_SERVICE, naming the entity for services that are nonrecurring as NON_RECURRING_SERVICE, and creating a new generic entity called
SERVICE that has RECURRING_SERVICE and NON_RECURRING_SERVICE as
category entities. Create an IDEF1X model: state the type of all relationships, give the
cardinalities, and name each relationship.
OWNER
SERVICE
Phone
OwnerName
Street
City
State
Zip
DateOfService
AmountBilled
AmountPaid
DateOfPayment
Z
Z
Z
NON_RECURRING_SERVICE
RECURRING SERVICE
Description
MonthsBetweenService
ServiceFee
Description
Owner and Service: Non-Identifying connection relationship, Owner may have from zero to
many Services, Service must belong to exactly one Owner, HasPerformed/PerformedFor
Service, Non-Recurring_Service, Recurring_Service: Categorization Relationship, A Service
must be either Non_recurring or Recurring but not both, each Non_Recurring and Recurring
subtype must belong to exactly one service.
D. Add an entity called CHIP_DELIVERY to your model in question C. To begin, assume
that none of Samantha’s trimming customers ever buy chips. Create a new entity
called CHIP_CUSTOMER for chip deliveries. Create an IDEF1X model: state the type
of all relationships, give the cardinalities, and name each relationship.
2-28
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
OWNER
SERVICE
Phone
OwnerName
Street
City
State
Zip
DateOfService
AmountBilled
AmountPaid
DateOfPayment
Z
Z
Z
CHIP_DELIVERY
Phone
CustomerName
Street
City
State
Zip
DateDelivered
LoadSize
AmountBilled
AmounPaid
NON_RECURRING_SERVICE
RECURRING SERVICE
Description
MonthsBetweenService
ServiceFee
Description
In this case there would be no new relationships. Chip_Delivery is not related to Customer
because Customers do not buy chips. Chip_Delivery is not a category entity because it is not a
Service. The primary reason for not making Chip_Delivery a Service is that a service must
belong to a Customer and the Chip_Delivery does not.
E. Answer question D, but assume that some of her trimming customers can also buy
chips. Use category entities to model the types of customers similar to that in question
C. Create an IDEF1X model: state the type of all relationships, give the cardinalities,
and name each relationship.
OWNER
SERVICE
Phone
OwnerName
Street
City
State
Zip
DateOfService
AmountBilled
AmountPaid
DateOfPayment
Z
CHIP_CUSTOMER
DateDelivered
LoadSize
AmountBilled
AmounPaid
Z
Z
NON_RECURRING_SERVICE
Description
2-29
Z
RECURRING SERVICE
Description
MonthsBetweenService
ServiceFee
Chapter Two Entity-Relationship Data Modeling: Tools and Techniques
In this case I would use only one category entity and use an incomplete categorization
relationship. The rationale is that not all Customers buy Chips but there are no additional
attributes about those that do not buy chips. All Chip_Customers must be Customers but not all
Customers are Chip_Buyers. All other relationships are the same as those in D above.
2-30
Download