0% found this document useful (0 votes)
228 views

Database Management System (Data Modelling) Answer Key - Activity 2

1. The document discusses data modeling and business rules. It explains that data models help communicate real-world environments and business rules define regulations and concepts within an organization. Business rules translate into entities, attributes, relationships and constraints in a data model. 2. It provides examples of how to translate business rules into data model components by identifying nouns as entities and verbs linking nouns as relationships. Standardization of data models is important for users and designers to work across different applications. 3. The relational data model structures data into tables with rows and columns and relates tables through common values. This provides simplicity for users and designers compared to previous data models.

Uploaded by

AJ Dela Cruz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
228 views

Database Management System (Data Modelling) Answer Key - Activity 2

1. The document discusses data modeling and business rules. It explains that data models help communicate real-world environments and business rules define regulations and concepts within an organization. Business rules translate into entities, attributes, relationships and constraints in a data model. 2. It provides examples of how to translate business rules into data model components by identifying nouns as entities and verbs linking nouns as relationships. Standardization of data models is important for users and designers to work across different applications. 3. The relational data model structures data into tables with rows and columns and relates tables through common values. This provides simplicity for users and designers compared to previous data models.

Uploaded by

AJ Dela Cruz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

INFORMATION MANAGEMENT - ASSIGNMENT

PART 1:
1. Discuss the importance of data modeling.

A data model is a representation of a more complex real-world object event that


is typically graphical. The primary goal of the data model is to assist us in understanding
the dynamics of the real world. Data models are used by database designers to help
designers, application programmers, and end users communicate more effectively. In a
nutshell, a good data model is a communication tool that aids in the elimination (or at
the very least, significant reduction) of inconsistencies between the database design's
components and the real-world data environment. The evolution of data models,
combined with the use of effective database design techniques, has made it possible to
significantly reduce the risk of database design errors.

2. What is a business rule, and what is its purpose in data modeling?

A business rule is a brief, accurate, and irrefutable definition of a regulation,


practice, or concept in the context of a particular organization. In certain ways, business
rules are misnamed: they refer to any organization that stores and uses data to produce
information, whether it's a business, a government unit, a religious organization, or a
research laboratory, large or small.
In addition, a business rule is derived from a “description of operations”. A
description of operations, as the name suggests, is a detailed narrative that explains an
organization's operating environment. Such a description necessitates a high level of
precision and detail. If the operations description is inaccurate or incomplete, the
business rules that are derived from it may not correctly represent the real-world data
environment, thus data models are poorly defined, resulting in poor database design.
Bad database designs, in turn, lead to poor implementations, which leads to poor
decision-making, which could eventually lead to the organization's downfall.
Business rules, in particular, help in the creation and enforcement of actions
within an organization's environment. Business rules must be written down and updated
as the operating environment of the organization changes.
Entities, attributes, relationships, and constraints are all described using well-
written business rules. The careful derivation and definition of business rules is crucial
to good database design since these components form the framework for a database
design.

3. How do you translate business rules into data model components?

A noun in a business rule will generally translate into an entity in the model, and
a verb (active or passive) associating nouns will translate into a relationship among the
entities. The business rule "a customer can generate several invoices" for example,
contains two nouns (customer and invoice) and a verb ("generate") that links them.
From this business rule, you could deduce that:
INFORMATION MANAGEMENT - ASSIGNMENT

 Customer and invoice are objects of interest for the environment and should be
represented by their respective entities.
 There is a “generate” relationship between customer and invoice.

To properly identify the type of relationship, you should consider that relationships
are bidirectional; that is, they go both ways. For example, the business rule “a customer
may generate many invoices” is complemented by the business rule “an invoice is
generated by only one customer.” In that case, the relationship is one-to-many (1:M).
Customer is the “1” side, and invoice is the “many” side.

4. What languages emerged to standardize the basic network data model, and why was such
standardization important to users and designers?

 The schema, which is the conceptual organization of the entire database as


viewed by the database administrator.

 The subschema, which defines the portion of the database “seen” by the
application programs that actually produce the desired information from the data
contained within the database.

 A data management language (DML), which defines the environment in which


data can be managed and to work with the data in the database.

 A schema data definition language (DDL), which enables the database


administrator to define the schema components.

Standardization is important to users and designers because it allows them to shift from
one commercial application to another with little trouble when they operate at the logical level.

5. Describe the basic features of the relational data model and discuss their importance to the
end user and the designer.

A relational database is a single data repository that retains conceptual simplicity while
providing structural and data independence. The user perceives the relational database model
as a collection of tables in which data is stored. Each table is made up of rows and columns,
just like a matrix. Tables are related to each other because one of their columns has a shared
common value.
The relational model is a game-changer for users and designers because it allows them
to work in a simpler conceptual environment. End users like to visualize their data as a
collection of data structured into a matrix. Designers prefer conceptual data representation
because it relieves them of the complexities associated with physical data representation.

6. Explain how the entity relationship (ER) model helped produce a more structured relational
database design environment.
INFORMATION MANAGEMENT - ASSIGNMENT

The entity relationship helped produce more structured relational database design by
making it easier to examine structures graphically rather than in text, the ER model has become
widely accepted standard for modeling. It quickly became popular because it complemented the
relational model concepts. The two combined to provide the foundation for tightly structured
database design.

7. Use the scenario described by “A customer can make many payments, but each payment is
made by only one customer” as the basis for an entity relationship diagram (ERD)
representation.

A one-to-many relationship: A customer can make or have many payment. While


payment can be done by only the said customer.

8. Why is an object said to have greater semantic content than an entity?

An object-oriented data model (OODM) reflects a very different way to define and use
entities. It is described by its factual content and unlike an entity, an object includes information
about relationships between the facts within the object, as well as information about its
relationships with other objects. Therefore, the facts within the object are given greater
meaning. The OODM is said to be a semantic data model because semantic indicates meaning.

9. What is the difference between an object and a class in the object-oriented data model
(OODM)?

An object is an abstract representation of a real-world entity that has a unique identity,


embedded properties and the ability to interact with other objects and itself. A class is a
collection of similar objects with shared structure(attributes) and behavior(methods). A class
encapsulates an object's data representation and a method's implementation. Classes are
organized in a class hierarchy; each class only has one parent. A class is a collection of similar
objects with shared structure. Object represents only one occurrence of an entity.

10. How would you model Question 7 with an OODM? (Use Figure 2.4 as your guide.)

11. What is an ERDM, and what role does it play in the modern (production) database
environment?
INFORMATION MANAGEMENT - ASSIGNMENT

An ERDM is an Extended relational data model. It adds many of the Object-Oriented


model's features within the inherently simpler relational database structure. ERDM gave birth to
a new generation of relational database that supports Object-Oriented features such as objects,
extensible data types based on classes, and inheritance.

12. In terms of data and structural independence, compare file system data management with
the five data models discussed in this chapter.

Hierarchical Data Model:


In a hierarchical data model, the data is represented in a three-like structure. The three-
like structures allow the representations of various parent/child relationships (PCRs). In PCR,
each of the parents has many children, but each child can have only one parent (also known as
a 1-to-many relationship). All attributes of a particular record are placed within an entity type.

Network Data Model:


A network data model represents the data relationships and improves database
performance by imposing various database standardization parameters. In a network model,
there can be more than one parent of a record. The network model thus became more useful
than the hierarchical data model as it imposed various standards and provided more
connectivity unlike the other data models.

Relational Data Model:


Relational data model was an advance model that took over the Hierarchical Model and
Network Model as these data models were very complex, and did not provide structural
independence or data independence. This model allows the data in the databases to be
manipulated using relational calculus or relational algebra.

Entity Relationship Model:


An ER model is a data representation model that is used to represent the business
rules of any problem set. The business rules are guidelines and narration scripts that guide the
database models and help the designers to develop the system by fully abiding with the
business policies, guidelines, protocols and procedures. By any means the information system
that caters to the organization must cater to its needs and abide by its rules to develop an
efficient database system. ER mode contains the entity which hold the attributes with them and
specify the relations between entities.

Object-Oriented Data Model


This model used to represents the complex real-world. In this, the object is defined, which
is the combination of both data and their relationship placed in a structure. The OODM has the
features of an object-oriented data language. In OODM, the focus is on “how” the problem is to
be solved, rather than “what” is to be achieved. The OODM model encapsulates the data into
classes and related objects which form the central base of the whole data model. This features
of OODM are – abstraction, encapsulation, information hiding, inheritance, polymorphism,
message parsing, etc.

13. What is a relationship, and what three types of relationships exist?


A relationship describes an association among entities. Three types of relationships
exist: one-to-one (1:1), one-to-many (1:M), and many-to-many (M:N or M:M.)
INFORMATION MANAGEMENT - ASSIGNMENT

14. Give an example of each of the three types of relationships.

One-to-one: An academic department is chaired by one professor; a professor may chair only
one academic department.

One-to-many: A customer may generate many invoices; each invoice is generated by one
customer.

Many-to-many: An employee may have earned many degrees; a degree may have been
earned by many employees.

15. What is a table, and what role does it play in the relational model?

The relational data model, strictly speaking, is based on relations for data storage. The
algebraic set theory underpins these relationships. The consumer, on the other hand, sees the
relationships as tables. Designers and users in the relational database world see a table as a
matrix made up of a series of row/column intersections. Tables, also known as relations, are
connected together because they share a common entity characteristic. For example, a
customer number in the INVOICE table points to the same number in the CUSTOMER table.
The RDBMS will use this function to connect invoices to the customers who generated them.
It's particularly useful from a modeling and implementation perspective. Tables provide
an easy way to summarize entity characteristics and relationships among entities since they are
used to describe the entities they represent. Furthermore, since they are merely conceptual
structures, the designer does not need to be concerned with the database design's physical
implementation.

16. What is a relational diagram? Give an example.

A relational diagram is a visual representation of the entities, attributes within those


entities, and relationships between those entities in a relational database. Therefore , it's simple
to find out what the entities represent and what types of relationships (1:1, 1:M, M:N) occur
between them, as well as how those relationships are implemented.

In this figure, the relational diagram shows the


connecting fields (in this case, AGENT_CODE) and the
relationship type, 1:M. Microsoft Access, the database
software application used to generate Figure 2.2,
employs the _ (infinity) symbol to indicate the “many”
side.

17. What is logical independence? In this example, the CUSTOMER represents the “many”
side because an AGENT can have many CUSTOMERs.
The AGENT represents the “1” side because each
CUSTOMER has only one AGENT.
INFORMATION MANAGEMENT - ASSIGNMENT

Logical data independence is the one which has power (ability) to change logical
schema without changing external schema or application. Logical data independence in
any database applications relate to views where we can only view the data rather than
modifying data.

Example:
Adding or removing entities, relationships, attributes, to conceptual schema is possible
without doing or performing any alteration in the external schemas or records. Renaming
attributes or tables does not affect any change in external schema.

18. What is physical independence?


Physical data independence is the ability to modify the physical schema without
causing application programs to be rewritten. It means we change the physical storage/level
without affecting the conceptual or external view of the data. The new changes are absorbed by
mapping techniques.

19. What is connectivity? (Use a Crow’s Foot ERD to illustrate connectivity.)


Connectivity is the relational term to describe the types of relationships (1:1, 1:M, M:N).

In the figure, the business rule that an advisor can advise many students and a student
has only one assigned advisor is shown with in a relationship with a connectivity of 1:M. The
business rule that a student can register only one vehicle to park on campus and a vehicle can
be registered by only one student is shown with a relationship with a connectivity of 1:1. Finally,
the rule that a student can register for many classes, and a class can be registered for by many
students, is shown by the relationship with a connectivity of M:N.
INFORMATION MANAGEMENT - ASSIGNMENT

Problem Solutions:
Use the contents of Figure 2.1 to work problems 1-3.
1. Write the business rule(s) that governs the relationship between AGENT and CUSTOMER.

Given the data in the two tables, you can see that an AGENT – through AGENT_CODE -- can
occur many times in the CUSTOMER table. But each customer has only one agent. Therefore,
the business rules may be written as follows:

 One agent can have many customers.


 Each customer has only one agent.
 Given these business rules, you can conclude that there is a 1:M relationship between
AGENT and CUSTOMER.
2. Given the business rule(s) you wrote in Problem 1, create the basic Crow’s Foot ERD.

Crow’s Foot ERD:

Chen’s ERD:

3. Using the ERD you drew in Problem 2, create the equivalent Object representation and UML
class diagram. (Use Figure 2.4 as your guide.)

The OO model

Using Figure P2.4 as your guide, work Problems 4–5. The DealCo relational diagram shows the
initial entities and attributes for the DealCo stores, located in two regions of the country.
INFORMATION MANAGEMENT - ASSIGNMENT

4. Identify each relationship type and write all of the business rules.

 One region can be the location for many stores. Each store is located in only one region.
Therefore, the relationship between REGION and STORE is 1:M.
 Each store employs one or more employees. Each employee is employed by one store.
(In this case, we are assuming that the business rule specifies that an employee cannot
work in more than one store at a time.) Therefore, the relationship between STORE and
EMPLOYEE is 1:M.
 A job – such as accountant or sales representative -- can be assigned to many
employees. (For example, one would reasonably assume that a store can have more
than one sales representative. Therefore, the job title “Sales Representative” can be
assigned to more than one employee at a time.) Each employee can have only one job
assignment. (In this case, we are assuming that the business rule specifies that an
employee cannot have more than one job assignment at a time.) Therefore, the
relationship between JOB and EMPLOYEE is 1:M. Note. These are assumptions prior in
mind the setting.

5. Create the basic Crow’s Foot ERD for DealCo.

The Crow’s Foot ERD for DealCo

The Chen’s ERD for DealCo


INFORMATION MANAGEMENT - ASSIGNMENT

Using Figure P2.6 as your guide, work Problems 6−8 The Tiny College relational diagram
shows the initial entities and attributes for Tiny College.

Figure P2.6 The Tiny College relational diagram


6. Identify each relationship type and write all of the business rules.

The simplest way to illustrate the relationship between ENROLL, CLASS, and STUDENT is to
discuss the data shown in Table P2.6. As you examine the Table P2.6 contents and compare
the attributes to relational schema shown in Figure P2.6, note these features:

 We have added an attribute, ENROLL_SEMESTER, to identify the enrollment period.


 Naturally, no grade has yet been assigned when the student is first enrolled, so we have
entered a default value “NA” for “Not Applicable.” The letter grade – A, B, C, D, F, I
(Incomplete), or W (Withdrawal) -- will be entered at the conclusion of the enrollment
period, the SPRING-12 semester.
 Student 11324 is enrolled in two classes; student 11892 is enrolled in three classes, and
student 10345 is enrolled in one class.

Table P2.6 Sample Contents of an ENROLL Table

STU_NUM CLASS_CODE ENROLL_SEMESTER ENROLL_GRADE


11324 MATH345-04 SPRING-14 NA
11324 ENG322-11 SPRING-14 NA
11892 CHEM218-05 SPRING-14 NA
11892 ENG322-11 SPRING-14 NA
11892 CIS431-01 SPRING-14 NA
INFORMATION MANAGEMENT - ASSIGNMENT

10345 ENG322-07 SPRING-14 NA

Business Rules:

 All of the relationships are 1:M. The relationships may be written as follows:
 COURSE generates CLASS. One course can generate many classes. Each class is
generated by one course.
 CLASS is referenced in ENROLL. One class can be referenced in enrollment many
times. Each individual enrollment references one class. Note that the ENROLL entity is
also related to STUDENT. Each entry in the ENROLL entity references one student and
the class for which that student has enrolled. A student cannot enroll in the same class
more than once. If a student enrolls in four classes, that student will appear in the
ENROLL entity four times, each time for a different class.
 STUDENT is shown in ENROLL. One student can be shown in enrollment many times.
(In database design terms, “many” simply means “more than once.”) Each individual
enrollment entry shows one student.

7. Create the basic Crow’s Foot ERD for Tiny College.

The Crow’s Foot Model for Tiny College

The Chen model for Tiny College


INFORMATION MANAGEMENT - ASSIGNMENT

8. Create the UML class diagram that reflects the entities and relationships you identified in the
relational diagram.
The OO Model for Tiny College

9. Typically, a patient staying in a hospital receives medications that have been ordered by a
particular doctor. Because the patient often receives several medications per day, there is a 1:M
relationship between PATIENT and ORDER. Similarly, each order can include several
medications, creating a 1:M relationship between ORDER and MEDICATION.
a. Identify the business rules for PATIENT, ORDER, and MEDICATION.

 The business rules reflected in the PATIENT description are:


A patient can have many (medical) orders written for him or her.
Each (medical) order is written for a single patient.

 The business rules reflected in the ORDER description are:


Each (medical) order can prescribe many medications.
Each medication can be prescribed in many orders.

 The business rules reflected in the MEDICATION description are:


Each medication can be prescribed in many orders.
Each (medical) order can prescribe many medications.

b. Create a Crow's Foot ERD that depicts a relational database model to capture these
business rules.
Crow's foot ERD for Problem 9
INFORMATION MANAGEMENT - ASSIGNMENT

10. United Broke Artists (UBA) is a broker for not-so-famous painters. UBA maintains a small
network database to track painters, paintings, and galleries. A painting is painted by a particular
artist, and that painting is exhibited in a particular gallery. A gallery can exhibit many paintings,
but each painting can be exhibited in only one gallery. Similarly, a painting is painted by a
single painter, but each painter can paint many paintings. Using PAINTER, PAINTING, and
GALLERY, in terms of a relational database:

a. What tables would you create, and what would the table components be?

We would create the three tables shown in Figure P2.10a. (Use the teacher’s Ch02_UBA
database in your instructor's resources to illustrate the table contents.)

The UBA Database Tables

 As you discuss the UBA database contents, note in particular the following business
rules that are reflected in the tables and their contents:
INFORMATION MANAGEMENT - ASSIGNMENT

 A painter can paint may paintings.


 Each painting is painted by only one painter.
 A gallery can exhibit many paintings.
 A painter can exhibit paintings at more than one gallery at a time. (For example, if a
painter has painted six paintings, two may be exhibited in one gallery, one at another,
and three at the third gallery. Naturally, if galleries specify exclusive contracts, the
database must be changed to reflect that business rule.)
 Each painting is exhibited in only one gallery.
 The last business rule reflects the fact that a painting can be physically located in only
one gallery at a time. If the painter decides to move a painting to a different gallery, the
database must be updated to remove the painting from one gallery and add it to the
different gallery.

b. How might the (independent) tables be related to one another?

The UBA Relational Diagram and their relationship

They all work back together by means of the painter paints the painting that is present in
a gallery. The gallery where the painting is present can only be one. Therefore, a painter can
have a painting inside the gallery or a gallery could have a painting painted by a painter.

11. Using the ERD from Problem 10, create the relational schema. (Create an appropriate
collection of attributes for each of the entities. Make sure you use the appropriate naming
conventions to name the attributes.)

The Relational Diagram for Problem 11

12. Convert the ERD from Problem 10 into the corresponding UML class diagram.

The basic OODM solution is shown in Figure P2.12.

The OODM for Problem 12


INFORMATION MANAGEMENT - ASSIGNMENT

13. Describe the relationships (identify the business rules) depicted in the Crow’s Foot ERD
shown in Figure P2.13.
The Crow’s Foot ERD for Problem 13

The business rules may be written as follows:

 A professor can teach many classes.


 Each class is taught by one professor.
 A professor can advise many students.
 Each student is advised by one professor.

14. Create a Crow’s Foot ERD to include the following business rules for the ProdCo company:

 Each sales representative writes many invoices.


 Each invoice is written by one sales representative.
 Each sales representative is assigned to one department.
 Each department has many sales representatives.
 Each customer can generate many invoices.
 Each invoice is generated by one customer.

The Crow’s Foot ERD for ProdCo company. Note that a 1:M relationship is always read from
the one (1) to the many (M) side. Therefore, the customer-invoice relationship is read as “one
customer generates many invoices.”
INFORMATION MANAGEMENT - ASSIGNMENT

Crow’s Foot ERD for the


ProdCo Company

15. Write the business rules that are reflected in the ERD shown in Figure P2.15. (Note that the
ERD reflects some simplifying assumptions. For example, each book is written by only one
author. Also, remember that the ERD is always read from the “1” to the “M” side, regardless of
the orientation of the ERD components.)

The Crow’s Foot ERD for Problem 15

The relationships are best described through a set of business rules:

 One publisher can publish many books.


 Each book is published by one publisher.
 A publisher can submit many (book) contracts.
 Each (book) contract is submitted by one publisher.
 One author can sign many contracts.
 Each contract is signed by one author.
 One author can write many books.
 Each book is written by one author.

This ERD will be a good basis for a discussion about what happens when more realistic
assumptions are made. For example, a book – such as this one – may be written by more than
one author. Therefore, a contract may be signed by more than one author. Your students will
learn how to model such relationships after they have become familiar with the material in
Chapter 3.

16. Create a Crow’s Foot ERD for each of the following descriptions. (Note: The word many
merely means “more than one” in the database modeling environment.)
INFORMATION MANAGEMENT - ASSIGNMENT

a. Each of the MegaCo Corporation’s divisions is composed of many departments. Each of


those departments has many employees assigned to it, but each employee works for only one
department. Each department is managed by one employee, and each of those managers can
manage only one department at a time.

The MegaCo Crow’s Foot ERD

 As you discuss the contents of this figure. Note the 1:1 relationship between the
EMPLOYEE and the DEPARTMENT in the “manages” relationship and the 1:M
relationship between the DEPARTMENT and the EMPLOYEE in the “is assigned to”
relationship.
 During some period of time, a customer can rent many videotapes from the BigVid store.
Each of the BigVid’s videotapes can be rented to many customers during that period of
time.
 The solution is presented in Figure P2.16b. Note the M:N relationship between
CUSTOMER and VIDEO. Such a relationship is not implementable in a relational model.

b. During some period of time, a customer can rent many videotapes from the BigVid store.
Each of BigVid’s videotapes can be rented to many customers during that period of time.
The BigVid Crow’s Foot ERD

ERD into an implementable ERD, add the third RENTAL entity to create a 1:M relationship
between CUSTOMER and RENTAL and a 1:M relationship between VIDEO and RENTAL.
INFORMATION MANAGEMENT - ASSIGNMENT

c. An airliner can be assigned to fly many flights, but each flight is flown by only one airliner.
The Airline Crow’s Foot ERD

d. The KwikTite Corporation operates many factories. Each factory is located in a region. Each
region can be “home” to many of KwikTite’s factories. Each factory employs many employees,
but each of those employees is employed by only one factory.
The KwikTite Crow’s Foot ERD

e. An employee may have earned many degrees, and each degree may have been earned by
many employees.
The Earned Degree Crow’s Foot ERD

1:M relationship

You might also like