Uploaded by Beatrice Sipala

Tutorial.2

advertisement
IS302 Database Design
Divine Word University
Tutorial 2: Entity-Relationship Model
1.
2.
What is the role of a high-level data model in the database design process?
It helps to identify and establish the entities, attributes and the relationships of a mini world.
Define the following terms: entity, attribute, attribute value, relationship instance, composite attribute,
multivalued attribute, derived attribute, complex attribute, key attribute, value set (domain).
Entity- An entity is any singular, identifiable and separate object. It refers to individuals, organizations, systems,
bits of data or even distinct system components that are considered significant in and of themselves.
Attribute- an attribute is a characteristic. In a database management system (DBMS), an attribute refers to
a database component, such as a table. It also may refer to a database field. Attributes describe the instances in
the row of a database.
Attribute Value- An attribute describes the property of an entity. An attribute is represented as Oval in an ER
diagram. There are four types of attributes:
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
Relationship Instance- A relation instance is a tuple or row in a relation, i.e. one particular combination of
attribute values. Let there be a relation Student. The schema of the relation Student has the following attributes:
{ID,first_name,last_name} Now each of the attributes have their own domain i.e. a range of values they can take
up.
Composite Attribute- This attribute can be further divided into more attributes.
Multivalued Attribute- These are the attributes which can have multiple values for a single or same entity.
Derived Attribute- These attributes are derived from other attributes. It can be derived from multiple attributes
and also from a separate table.
Complex Attribute- For an entity, if an attribute is made using the multi valued attributes and composite
attributes then it is known as complex attributes.
3.
4.
5.
Key Attribute- This attribute represents the main characteristic of an entity i.e. primary key. Key attribute has
clearly different value for each element in an entity set.
Value Set (Domain)- Each attribute of an entity type is associated with a value set. This value set is also called
domain. The domain of an attribute is the collection of all possible values an attribute can have.
Differentiate between an entity, entity type and entity set?
Entity type is the category of a particular entity in the table of an RDBMS; in contrast, entity set refers to the
collection of all entities of the same entity type in RDBMS. Thus, this is the main difference between Entity Type
and Entity Set.
Differentiate between relationship instance, a relationship type, and a relationship set.
The differences between a relationship instance, a relationship type, and a relationship set are: Relationship
instance is an association of entities, where the association includes exactly one entity from each participating
entity type. Relationship type defines a relationship set among entities from these types.
What is a participation role? When is it necessary to use role names in the description of relationship types?
The Participation role is the part that every entity participates in a relationship. This role is important to use role
name in the depiction of relationship type when the similar entity type participates more than once in
a relationship type in various roles. The role names are necessary in recursive relationships.
6.
Describe the two alternatives for specifying structural constraints on relationship types. What are the advantages
and disadvantages of each?
The two alternatives for specifying structural constraints on relationship types are as follows:
Cardin ality ratio
Participation constraint
Cardinality Ratio: The entity can participate in any number of relationship instances. The cardinality ratio specifies the maximum
participation of the entity.
Participation constraint: The participation constraint specifies the minimum participation of the entity. It is also called as minimum
cardinality constraint. There are two types of participation constraints. They are total and partial participation constraints.
Advantages and disadvantages:
The cardinality ratio and participation constraint specify the participation of the entity in the relationship instances.
These two are helpful in describing the binary relationship types.
7. Under what conditions can an attribute of a binary relationship type be migrated to become an attribute of one
of the participating entity types?
An attribute of a binary relationship type can be migrated to become an attribute of one participating entity type
when the relationship type is 1:1 or 1:N. This is because each entity participates in at most one
relationship instance.
8. What is meant by a recursive relationship type? Give some examples of recursive relationship types.
When there is a relationship between two entities of the same type, it is known as a recursive relationship. This
means that the relationship is between different instances of the same entity type. Some examples of recursive
relationship can be shown as follows: An employee can supervise multiple employees
9. When is the concept of a weak entity used in data modeling? Define the terms owner entity type, weak entity
type, identifying relationship type, and partial key.
10. Can an identifying relationship of a weak entity type be of a degree greater than two? If so, give examples to
illustrate your answer.
11. Elmasri & Navathe: Chapter 3: Exercise 3.22
A database is being constructed to keep track of the teams and games of a sports league. A team has a number
of players, not all of whom participate in each game. It is desired to keep track of the players participating in
each game, the positions they played in that game, and the result of the game. Try to design an ER diagram for
this application, stating any assumptions you make
12. Elmasri & Navathe: Chapter 3: Exercise 3.23
Consider the ER diagram shown in Figure 3.17 for part of a BANK database. Each bank can have multiple
branches, and each branch can have multiple accounts and loans.
a. List the nonweak entity types in the ER diagram: BANK, CUSTOMER, ACCOUNT, LOAN
b. Is there a weak entity type? If so, give its name, partial key and identifying relationship.
Weak entity type: BANK-BRANCH, Partial Key: Bank_Code, BranchNo
c. What constraints do the partial key and the identifying relationship of the weak entity type specify in this
diagram? Total Participation for BANK_BRANCH, 1:N for BANKS and N:1 for BANK-BRANCH
d. List the names of all relationship types, and specify the (min, max) constraint on each participation of an
entity types in a relationship type.
(1, N) for BANK on BRANCHES & (1, 1) for BANK_BRANCH on BRANCHES
Copyright @ 2013, Divine Word University
Page | 1
Download