You are on page 1of 30

Chapter 13 Systems Analysis and Design Instructor’s Manual 13-1

Chapter 13
Designing Databases
Key Points and Objectives
1. The objectives in the design of data storage organization are:

A. The data must be available when the user wants to use it.
B. The data must have integrity; it must be accurate and consistent.
C. There must be efficient storage of data as well as efficient updating and retrieval.
D. It is necessary that information retrieval be purposeful.
E. The information obtained from the stored data must be in an integrated form to be useful
for managing, planning, controlling, or decision making.

2. There are two approaches to the storage of data in a computer-based system. The first method is
to store the data in individual files, each unique to a particular application. The second approach
to the storage of data in a computer-based system involves building a database, which is a
formally defined and centrally controlled store of data intended for use in many different
applications.

3. A file can be designed and built quite rapidly, and the concerns for data availability and security
are minimized.

4. The effectiveness objectives of the database include:

A. Ensure that data can be shared among users for a variety of applications.
B. Maintain data that are both accurate and consistent.
C. Ensure all data required for current and future applications will be readily available.
D. Allow the database to evolve and the needs of the users to grow.
E. Allow users to construct their personal view of the data without concern for the way the
data are physically stored.

5. Entities are objects or events for which data is collected and stored.

6. An entity subtype represents data about an entity that may not be found on every record.

7. Relationships are associations between entities. They may be one-to-one, one-to-many, or many-
to-many. Relationships are shown with a either a zero on the relationship line (representing
none), a small vertical line crossing the relationship line (representing one), or a crow’s foot
symbol, representing many.

8. A self-join is when a record has a relationship with another record on the same file.

9. Attributes are a characteristic of an entity, sometimes called a data item.

10. Records are a collection of data items that have something in common.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-2

11. Keys are data items in a record used to identify the record. Key types are:

A. Primary key, unique for the record.


B. Secondary key, a key which may not be unique.
C. Concatenated key, or composite key, a combination of two or more data items for the
key.
D. Foreign key, a data item in one record that is the key of another record.

12. Primary keys based on an attribute are risky. If the attribute changes, the primary key would
change.

13. Some databases allow the developer to use an object identifier (OID), which uniquely identifies a
record in the database regardless of the table on which it exists.

14. A file contains groups of records used to provide information for operations, planning,
management, and decision making. Files can be used for storing data for an indefinite period of
time, or they can be used to store data temporarily for a specific purpose. The following types of
files are available for different purposes: master file, table file, transaction file, work file, and
report file.

15. Master files have long records and contain all pertinent information about an entity. Transaction
records are short and contain information used to update master files.

16. According to the specific characteristics of a particular application system, systems analysts may
choose different organizational structures for the file design. The available file organizations are:
sequential organization, linked lists, and hashed file organization.

17. A database, unlike a file, is intended to be shared by many users. It is clear that each user sees the
data in different ways. The most common approach is to use a relational database.

18. Normalization is the transformation of complex user views and data to a set of smaller, stable,
and easily maintainable data structures. The three steps of data normalization are:

A. Remove all repeating groups and identify the primary key.


B. Ensure that all nonkey attributes are fully dependent on the primary key.
C. Remove any transitive dependencies, attributes which are dependent on other nonkey
attributes.

19. The entity-relationship diagram may be used to determine record keys.

20. When the relationship is one-to-many, the primary key of the file at the one end of the
relationship should be contained as a foreign key on the file at the many end of the relationship.

21. A many-to-many relationship should be divided into two one-to-many relationships with an
associative entity in the middle.

22. Guidelines for creating master files or database relations are:

A. Each separate entity should have its own master file or database relation.
B. A specific, nonkey data field should exist on only one master file or relation.
C. Each master file or relation should have programs to create, read, update, and delete
records.

23. When a one-to-many relationship exists, the many end may be implemented as a drop-down list,

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-3

or repeating groups of fields on a display screen.

24. There are three integrity constraints that help to ensure that the database contains accurate data:

A. Entity integrity constraints, which govern the composition of primary keys.


B. Referential integrity, which governs the nature of records in a one-to-many relationship.
C. Domain integrity, which defines rules that ensure that only valid data is stored on
database records. Domain integrity has two forms:

i. Check constraints, which are defined at the table level.


ii. Rules, which are defined as separate objects and may be used within a number of
fields.

25. There are four anomalies that may occur when creating database tables:

A. Data redundancy occurs when the same data are stored in more than one place in the
database.
B. An insert anomaly occurs when the entire primary key is not known and the database
cannot insert a new record.
C. A deletion anomaly happens when a record is deleted, resulting in the loss of other
related data.
D. An update anomaly results when a change to one attribute value either causes the
database to contain inconsistent data or causes multiple records to need changing.

26. The following guidelines are available to retrieve and present data in a database effectively:

A. Choose a relation from the database.


B. Join two relations together.
C. Project columns from the relation.
D. Select rows from the relation.
E. Derive new attributes.
F. Index or sort rows.
G. Calculate totals and performance measures.
H. Present data.

27. Denormalization is the process of taking the logical data model and transforming it into an
efficient physical model.

28. Data warehouses are used to organize information for quick and effective queries. The differences
between data warehouses and traditional databases are:

A. In the data warehouse, data is organized around major subjects.


B. Data in the warehouse is stored as summarized rather than detailed raw data.
C. Data in the data warehouse cover a much longer time frame than in a traditional
transaction-oriented database.
D. Data warehouses are organized for fast queries.
E. Data warehouses are usually optimized for answering complex queries, known as OLAP.
F. Data warehouses allow for easy access via data-mining software called siftware.
G. Data warehouses include multiple databases that have been processed so that data is
uniformly defined, containing what is referred to as “clean” data.
H. Data warehouses usually contain data from outside sources.

29. Online analytic processing (OLAP) is meant to answer decision makers’ complex questions by
defining a multidimensional database.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-4

30. Data mining, or knowledge data discovery (KDD) is the process of identifying patterns that a
human is incapable of detecting. Data mining has a number of decision aids available, including:

A. Statistical analysis
B. Decision trees
C. Neural networks
D. Fuzzy logic
E. Data visualization

31. Data mining patterns that decision makers try to identify include:

A. Associations, which are patterns that occur together.


B. Sequences, patterns of actions that take place over a period of time.
C. Clustering, patterns that develop among groups of people.
D. Trends, the patterns that are noticed over a period of time.

32. Business intelligence (BI) is a decision support system (DSS) for organizational decision makers.
It is composed of features that gather and store data and uses knowledge management approaches
combined with analysis that becomes input to decision makers’ decision-making processes.

33. There are five prominent methods are used for analyzing business intelligence:

A. Slice-and-dice drilldown
B. Ad hoc queries
C. Real-time analysis
D. Forecasting
E. Scenarios

34. Big data is when data sets become too large or too complex to be handled with traditional tools or
within traditional databases or data warehouses.

35. Text analytics is a way to structure the unstructured, turning qualitative material into quantitative
material. It is used to tap into qualitative unstructured data that can be of use to decision makers
who must recommend courses of action to their organizations that are backed by data.

36. Sources of big data for text analytics include unstructured, qualitative, or “soft,” data generated
through:

A. Blogs
B. Chat rooms
C. Questionnaires using open-ended questions
D. Online discussions conducted on the Web
E. Social media

Consulting Opportunity 13.1 (p. 362)


Hitch Your Cleaning Cart to a Star

Usually, a database is developed to improve both the effectiveness and the efficiency of data processing
by eliminating data duplication. According to the given information, the Marc Schnieder Janitorial Supply
company’s situation is a legitimate candidate for a database development.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-5

To develop a common database for the company, systems analysts or the database designer should
identify information needs first, and then establish standards for company operations such as commission
rate.

To select the best solution, systems analysts may examine the current system including reports, layouts,
file layouts, screen layouts, and the programs to check the possibility of modification. However, under the
given situation, development of a new system, including a new database design, may be the best solution
for the company because they can expect elimination of data duplication, and better control over the
operation of branch offices through a common database.

Consulting Opportunity 13.2 (p. 388)


Storing Minerals for Health, Data for Mining

Other databases that Marathon might consider merging into the data warehouse are nutritional supplement
customers, exercise equipment customers, databases from holistic healers, databases for specialty groups,
such as athletes or expectant mothers, databases that are used to keep track of customers that subscribe to
nutritional or organic lifestyle magazines, and so on.

Patterns that should be identified are associations, such as customers that purchase nutritional
supplements such as protein powders and vitamins; sequences, such as an expectant mother purchasing
supplements or persons using Echinacea during the cold season; clustering, such as supplements
purchased by college students at a particular campus; and trends, such as an increase in the use of herbal
supplements taken for well-being and as preventive measures.

Consulting Opportunity 13.3 (p. 390)


Losing Prospects

Some of the techniques to identify internal and external duplicates in the company’s marketing database
are:

a) Sort the prospective database and the customer database by name and compare them by sequentially
reading records and eliminating duplicates.

b) Use the same technique to compare purchased databases against one another to eliminate duplicates.

c) Check for different spellings of the same name at the same address. For example, Tom Brown and
Thomas Brown, both at 123 Oak Street.

d) Enlist the help of the sales reps to inform the marketing area when they encounter a prospective
customer that is already a customer.

e) Provide easy change of address forms that are sent out with every bill to ensure that the correct
address is on file.

HyperCase Experience 13
1. Applying normalization means first removing repeating groups. In this case, CLIENT-ID,
CLIENT-NAME, CONTACTS, CLASS, and STAFF-SIZE would repeat for various EQUIP-

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-6

TYPE. The resulting tables are:

CLIENT EQUIPMENT
============== ==============
CLIENT-ID CLIENT-ID
(primary key) (primary key)
CLIENT-NAME EQUIP-MODEL-YR
ADDRESS (primary key)
CONTACTS EQUIP-QTY
PHONE-NUMBER EQUIP-TYPE
CLASS
STAFF-SIZE
TRAINING-LEVEL

In addition, CONTACTS and PHONE-NUMBER would still be repeating groups within


CLIENT, yielding:

CLIENT CONTACTS
EQUIP
============== ==============

==============
CLIENT-ID CONTACT-
NAME CLIENT-ID
(primary key) (primary key)

(primary key)
CLIENT-NAME CLIENT-ID
EQUIP-
MODEL-YR
ADDRESS PHONE-
NUMBER
(primary key)
CLASS

EQUIP-QTY
STAFF-SIZE

EQUIP-TYPE
TRAINING-LEVEL

2. The next step is to remove partial dependencies. In this case the EQUIP-TYPE depends on
EQUIP-MODEL-YR whereas EQUIP-QTY depends on the entire compound key. The resulting
tables are:

CLIENT CONTACTS
============== ==============
CLIENT-ID CONTACT-NAME
(primary key) (primary key)
CLIENT-NAME CLIENT-ID
ADDRESS PHONE-NUMBER
CLASS

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-7

STAFF-SIZE
TRAINING-LEVEL

CLIENT-EQUIP EQUIPMENT
============== ==============
CLIENT-ID EQUIP-MODEL-YR
(primary key) (primary key)
EQUIP-MODEL-YR EQUIP-TYPE
(primary key)
EQUIP-QTY

The last step is to remove any transitive dependencies. In this case, the minimum training level is
assigned to various hospital classes. Thus, TRAINING-LEVEL is dependent on CLASS (and
only transitively dependent on CLIENT-ID). Yielding:

CLIENT TRAINING-REQUIRED
============== ==============
CLIENT-ID CLASS
(primary key) (primary key)
CLIENT-NAME TRAINING-LEVEL
ADDRESS
CLASS
STAFF-SIZE

CONTACTS CLIENT-EQUIP
============== ==============
CONTACT-NAME CLIENT-ID
(primary key) (primary key)
CLIENT-ID EQUIP-MODEL-YR
PHONE-NUMBER (primary key)
EQUIP-QTY

EQUIPMENT
==============
EQUIP-MODEL-YR
(primary key)
EQUIP-TYPE

Answers to Review Questions


1. What are the advantages of organizing data storage as separate files?

By using files for data storage, systems analysts may expect such advantages as rapid design and
building, minimized concerns for data availability and security.

2. What are the advantages of organizing data storage using a database approach?

The advantages of database for data storage are:

A. Data needs to be stored only once for several applications. This implies cost efficiency in
terms of storage space and maintenance.
B. High data integrity.
C. The data have a better chance of being available in a database than in a conventional file

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-8

system.
D. More flexible than separate files.
E. Allow users their own view of data.

3. What are the effectiveness measures of database design?

The major effectiveness measures of database design:

A. Ensure that data can be shared among users for a variety of applications.
B. Maintain data that are both accurate and consistent.
C. Ensure all data required for current and future applications will be readily available.
D. Allow the database to evolve and the needs of the user to grow.
E. Allow users to construct their personal view of the data without concern for the way the
data are physically stored.

4. List some examples of entities and their attributes.

Any object or event about which someone chooses to collect data is an entity; for example, a
salesperson, a city, or a product.

5. What is the difference between a primary key and an object identifier?

A primary key identifies one record for a given table. An object identifier identifies one record in
the entire database, regardless of the table on which the record exists.

6. Define the term “metadata.” What is the purpose of metadata?

Metadata is the information that describes data in the file or database. This is used to help users
understand the form and structure of the data by providing necessary information about the data
itself.

7. List types of commonly used conventional files. Which of these are temporary files?

The types of commonly used conventional files are: master files, table files, transaction files,
work files, and report files. Among these files, master files and table files are permanent, and the
rest are temporary files.

8. Name the three main types of database organization.

They are hierarchical database structure, network database structure, and relational database
structure.

9. Define the term “normalization.”

Normalization is the transformation of complex user views and data to a set of smaller, stable
data structures.

10. What is removed when a relation is converted to the first normal form?

All repeating groups are removed and the primary keys are identified when a relation is converted
to the first normal form.

11. What is removed when a relation is converted from 1NF to 2NF?

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-9

All the partially dependent attributes are removed and placed in another relation when a relation
is converted from 1NF to 2NF.

12. What is removed when a relation is converted from 2NF to 3NF?

Any transitive dependencies, nonkey attributes dependent on other nonkey attributes, are
removed when a relation is converted from 2NF to 3NF.

13. List the three entity constraints. In a sentence, describe the meaning of each entity constraint.

The three integrity constraints are:

A. Entity integrity constraints, which govern the composition of primary keys.


B. Referential integrity, which governs the nature of records in a one-to-many relationship.
C. Domain integrity, which defines rules that ensure that only valid data is stored on
database records.

14. Describe the four anomalies that may occur when creating database tables.

The four anomalies are:

A. A data redundancy anomaly that occurs when the same data are stored in more than one
place in the database.
B. An insert anomaly is when the entire primary key is not known and the database cannot
insert a new record.
C. A deletion anomaly that happens when a record is deleted, resulting in the loss of other
related data.
D. An update anomaly occurs when a change to one attribute value either causes the
database to contain inconsistent data or causes multiple records to need changing.

15. List the eight steps for retrieving, presorting, and presenting data.

The eight steps for retrieving and presenting data are:

A. Choose a relation from the database.


B. Join two relations together.
C. Project columns from the relation.
D. Select rows from the relation.
E. Derive new attributes.
F. Index or sort rows.
G. Calculate totals and performance measures.
H. Present data.

16. What does join do? What is projection? What is selection?

The operation join is intended to take two relations and put them together to make a larger
relation. In order for two relations to be joined, they must have a common attribute. Next,
projection is the process of building a smaller relation by choosing only relevant attributes from
an existing relation. Finally, selection is similar to projection, but instead of extracting columns it
extracts rows. Selection creates a new (smaller) relation by extracting records that contain an
attribute meeting a certain condition.

17. Define denormalization.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-10

Denormalization is the process of taking the logical data model and transforming it into an
efficient physical model.

18. Explain the differences between traditional databases and data warehouses.

Data warehouses are used to organize information for quick and effective queries. The differences
between data warehouses and traditional databases are:

A. In the data warehouse, data is organized around major subjects.


B. Data in the warehouse is stored as summarized rather than detailed raw data.
C. Data in the data warehouse cover a much longer time frame than in a traditional
transaction-oriented database.
D. Data warehouses are organized for fast queries.
E. Data warehouses are usually optimized for answering complex queries, known as OLAP.
F. Data warehouses allow for easy access via data-mining software called siftware.
G. Data warehouses include multiple databases that have been processed so that data is
uniformly defined, containing what is referred to as “clean” data.
H. Data warehouses usually contain data from outside sources.

19. What is data mining?

Data mining can identify patterns that a human is unable to detect by using algorithms to search
data warehouses for patterns that include associations, sequences, clustering, and trends.

20. What features compose business intelligence (BI)?

The features that compose business intelligence are gathering and storing data, and using
knowledge management approaches combined with analysis.

21. What is big data?

Big data is when data sets become too large or too complex to be handled with traditional tools or
within traditional databases or data warehouses.

22. Define business analytics.

Business analytics uses quantitative tools to analyze big data and inform decisions of managers
and computer systems.

23. What is text analytics?

Text analytics is a way to structure the unstructured, turning qualitative material into quantitative
material. It is used to tap into qualitative unstructured data that can be of use to decision makers
who must recommend courses of action to their organizations that are backed by data.

24. What are the sources of big data for text analytics?

The sources of big data for text analytics are unstructured qualitative, or “soft,” data generated
through blogs, chat rooms, questionnaires using open-ended questions, online discussions
conducted on the Web, and exchanges occurring on social media such as Facebook, Twitter, and
other Web-generated dialogs between customers and an organization.

Problems

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-11

1. Given the following file of renters:

Record Last Name Apartment Rent Lease


Number Number Expires
41 Warkentin 02 550 4/30
42 Buffington 204 600 4/30
43 Schuldt 103 550 4/30
44 Tang 209 600 5/31
45 Cho 203 550 5/31
46 Yoo 203 550 6/30
47 Pyle 101 500 6/30

a. Show an example of projection.


b. Show an example of selection.
c. Show two different examples of sorting rows.
d. Show an example of calculating totals.

a. Selection is creating a smaller table by selecting attributes or columns from the database.
The results will vary by student, but an example is shown below.

Last Name Rent Lease Expires


Warkentin 550 4/30
Buffington 600 4/30
Schuldt 550 4/30
Tang 600 5/31
Cho 550 5/31
Yoo 550 6/30
Pyle 500 6/30

b. Selection includes only certain rows in the table. Results will vary by student. An example is
shown below for rows that have a lease expiring on 5/31.

Record Number Last Name Apartment Rent Lease Expires


Number
44 Tang 209 600 5/31
45 Cho 203 550 5/31

c. Sorting may occur on any attribute. Results will vary by student. An example of sorting by
Last Name is shown below.

Record Number Last Name Apartment Rent Lease Expires


Number
42 Buffington 204 600 4/30
45 Cho 203 550 5/31
47 Pyle 101 500 6/30
43 Schuldt 103 550 4/30
44 Tang 209 600 5/31
41 Warkentin 02 550 4/30
46 Yoo 203 550 6/30

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-12

d. The only example of calculating totals is to sum the rent. In this case, it would add up to
3900.

2. The following is an example of a grade report for two students at the University of Southern New
Jersey:

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-13

USNJ Grade Report


Spring Semester 2012
Name: I. M. Smarte Major: MIS
Student: 053-6929-24 Status: Senior
Professor’s
Course Number Course Title Professor Department Grade
MIS 403 Systems Analysis Diggs, T. MIS A
MIS 411 Conceptual Foundations Barre, G. MIS A
MIS 420 Human Factors in IS Barre, G. MIS B
CIS 412 Database Design Menzel, I. CIS A
DESC 353 Management Models Murney, J. MIS A

USNJ Grade Report


Spring Semester 2012
Name: E.Z. Grayed Major: MIS
Student: 472-6124-59 Status: Senior
Professor’s
Course Number Course Title Professor Department Grade
MIS 403 Systems Analysis Diggs, T. MIS B
MIS 411 Conceptual Foundations Barre, G. MIS A

Student Courses
Take
Are
Taught
By

Department Professors
Has
Note: there is no question asked for problem 2. It is used in problems 3 and 4.

Draw a data model diagram with associations for the user view in Problem 2.

The data model diagram is illustrated below.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-14

Data model diagram, attribute relationships.

Name

Student
Major
Number

Status

Student No + Grade
Course + Term

Professor

Course
Course Title Department
Number

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-15

3. Convert the user view in Problem 3 to a 3NF relation. Show each step along the way.

Un-normalized

STUDENT STUDENT MAJOR STATUS COURSE COURSE TERM PROFESSOR PROFESSOR GRADE
NUMBER NAME NUMBER (1-N) TITLE (1-N) (1-N) DEPARTMENT (1-N)
(1-N) (1-N)

1st normal form

STUDENT
STUDENT STUDENT MAJOR STATUS
NUMBER NAME

STUDENT-COURSE
COURSE COURSE TERM PROFESSOR PROFESSOR GRADE
NUMBER TITLE DEPARTMENT

2nd normal form (STUDENT same as above)

STUDENT-COURSE
COURSE TERM PROFESSOR PROFESSOR GRADE
NUMBER DEPARTMENT

COURSE
COURSE COURSE
NUMBER TITLE

3rd normal form (STUDENT and COURSE same as above)

STUDENT-COURSE
COURSE TERM PROFESSOR GRADE
NUMBER

PROFESSOR
PROFESSOR PROFESSOR
DEPARTMENT

4. What problem might arise when using a primary key of course number for the data in Problem
2? (Hint: think about what would happen if the Department Name [not shown in the data]
changes.)

The problem is that the Course Description may change and the course number for students
taking the original course would not change. The current Course Description might be “Systems
Analysis” and the new Course Description might be “Object-Oriented Systems Analysis.” As a
result, transcripts sent out would contain the new name, even if the student did not take the new
course.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-16

5. Draw an entity-relationship diagram for the following situation: Many students play many
different sports. One person, called the head coach, assumes the role of coaching all these sports.
Each of the entities has a number and a name. (Make any assumptions necessary to complete a

Student Student Number

Belongs
Has To

Student Sports Student Number +


Sport Number

Has
Player Participates
Sports In

Coaches
Sport Head Coach
Coached By

Sport Number Coach Number


reasonable diagram. List your assumptions.)

The assumptions used when drawing this diagram are that each sport has a unique head coach but
that person may be responsible for several sports played in different seasons. Each student may
play in many sports in different seasons and each sport is played by many students.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-17

6. The entity-relationship diagram you drew in Problem 5 represents the data entities that are
needed to implement a system for tracking students and the sports teams that they play. List the
files that are needed to implement the system, along with primary, secondary, and foreign keys
that are required to link the files.

The files and keys necessary to implement the sports/coaches entity-relationship diagram are:

File Keys

Student Primary: Student number


Secondary: Student name

Sport Primary: Sport number


Secondary: Sport name
Foreign: Head coach number

Student-sport Primary: Student number + Sport number


Foreign: Student number
Foreign: Sport number

Coach Primary: Coach number


Secondary: Coach name

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-18

7. Draw an entity-relationship diagram for the following situation: A commercial bakery makes
many different products. These products include breads, desserts, specialty cakes, and many
other baked goods. Ingredients such as flour, spices, and milk are purchased from vendors.
Sometimes an ingredient is purchased from a single vendor, and other times an ingredient is
purchased from many vendors. The bakery has commercial customers, such as schools and
restaurants, that regularly place orders for baked goods. Each baked good has a specialist that
oversees the setup of the bakery operation and inspects the finished product.

The commercial bakery entity-relationship diagram is shown below. Note that the bakery itself is
not included as an entity, because there would not be a file of bakeries.

Specialist Number
Specialist

Managed Manages
By
Product Number +
Product Number Ingredient Number Ingredient Number

Have Are For


Product Product Ingredient Ingredient
Made Used In
From

Contained Contain Used


In Supply From

Product Number + Vendor Number +


Customer Product Customer Number Ingredient Number Vendor Ingredient

Purchased Purchased
Order By Sell From

Regular Customer Customer Number Vendor Number Vendor

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-19

8. List the files and keys that are needed to implement the commercial bakery system.

The files or database tables and keys necessary to implement the commercial bakery entity-
relationship diagram are:

Table Keys
Specialist Primary: Specialist number
Foreign: Employee number

Product Primary: Product number


Secondary: Product description
Foreign: Specialist number

Ingredient Primary: Ingredient number


Secondary: Ingredient description

Product-ingredient Primary: Product number + Ingredient number


Foreign: Product number
Foreign: Ingredient number

Vendor Primary: Vendor number


Secondary: Vendor name

Vendor-ingredient Primary: Vendor number + Ingredient number


Foreign: Vendor number
Foreign: Ingredient number

Customer Primary: Customer number


Secondary: Customer name

Customer-product Primary: Customer number + product number


Foreign: Customer number
Foreign: Product number

9. Draw an E-R diagram for the ordering system in Figure 13.24.

The diagram follows.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-20

10. D
Places D1
Customer Master r
Customer Order a
Placed By Customer w
Record
a
1 2
Customer
Order
Enter New
Are
Customer Number Read
Customer Customer
Order Sold Contains
Master
Via
Item
Item
Number
Quantity
4
Item
Record
Has
D2 Item Read Item
Order Item Customer
Item Master Are For
Record Number

Item data flow


Number diagram
for placing
an 5 3 order.
Base
D4
Order Item File
Create Item
Order Record
Add Order
Record
your data
Order Number
flow
Order diagram
Item Record
on Order the E-R
Record diagram.

The D6
Order File diagram
follows.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-21

11. Create an entity-relationship diagram for a genealogy software package called “PeopleTree” to
keep track of ancestors. Assume that each person will be on a Person table and that one person
may have one biological father and mother as well as an adopted mother and father. The mothers
and fathers must be stored on the Person table as well. Each person should have only one
birthplace, stored on the Place table. Many people may be born in the same place.

The entity-relationship diagram is shown below.

12. Define the primary key used for the Person and Place tables.

Person table: primary key is person number. The primary key could also be a concatenated key of
the person’s birth name, the birth place, and the birth date. However, this would make the key
excessively long.

Place table: primary key could be a number or it could be a concatenated key of Country, State,
and City or Town. Problems arise with this concatenated key because the city name may change.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-22

13. GaiaOrganix is an organic food wholesale co-op linking producers and consumers. GaiaOrganix
negotiates purchases by grocery and other stores from farmers who raise a variety of crops, such
as fruit, vegetable, and grain. Each farmer may produce a number of crops, and each crop may
be produced by a number of farmers. To provide the highest level of fresh products, the produce
is shipped directly from the farm to the store. Each store may purchase from many farms, and
each farm may sell to many stores. Draw an entity relationship diagram in the third normal form
showing the relationship between producer (farms) and the retailer (stores).

The entity-relationship diagram is shown below. The problem asks to show the relationship
between producers and retailers, and that is shown in the first diagram. If the crop is to be
included, that is shown in the second diagram.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-23

14. ArticleIndex.com is a company that produces indexes of magazine and periodical articles for a
given discipline. A Web user should be able to enter an article topic or authors and receive a
detailed list of all the articles and periodicals in which the topic was found. Each article may
have many authors, and each author may write many articles. An article may be found in only
one periodical, but each periodical will usually contain many articles. Each article may have
many topics, and each topic may be in many articles. Draw an entity relationship diagram in the
third normal form for the articles, authors, periodicals, and topics.

The entity-relationship diagram is shown below.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-24

15. Identify the primary and foreign keys for the entity-relationship diagram created in Problem 15.

The primary and foreign keys are:


Table Name Primary Key Secondary Key
Periodical Date Published (yyyymmdd)
Article Article Number (either an autosequence Date Published
number or a block sequence number, with Article Title
the Date Published defining the block

Article Author Article Number + Author Number Article Number


Could use an autosequence number as well. Author Number
Author Author Number (autosequence) Author Name
Article Topic Article Number + Topic Number
Could use an autosequence number as well.
Topic Topic Number (autosequence) Topic Description
Group Projects
1. Gregg Baker orders tickets for two concerts over the Web. His orders are processed, exact seat
locations are assigned, and the tickets are mailed separately. One of the sets of tickets gets lost in
the mail. When he calls the service number, he does not remember the date or the seat numbers,
but the ticket agency was able to locate his tickets quickly because the agency denormalized the
relation. Describe the ticket ordering system by listing the data elements that are kept on the
order form and the shipping form. What information did Gregg give the ticket agency to retrieve
the information?

The minimum number of data elements kept on the shipping form would need to be:

Customer Number
Customer Name
Customer Address
Concert Dates

The minimum number of data elements kept on the order form would need to be:

Customer Number
Customer Name
Customer Telephone
Number of Concerts
Concert ID or Dates
Number of Tickets
Concert Seat Location for Each Ticket

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-25

Central Pacific University—Problems


1. Use Microsoft Visio or Visible Analyst to view the unnormalized and first normal form entity-
relationship diagrams for the computer system. Double click on the entities to view the repository
information. (You do this in both Microsoft Visio and Visible Analyst. In Microsoft Visio the
repository entry is in an area on the bottom of the display. You may have to drag the border
separating the diagram from the repository upward. Click the Columns entry in the Categories
area on the left side of the repository to view the entity attributes.) The diagram name is
COMPUTER SYSTEM—UNNORMALIZED.

These diagrams are illustrated in the text. The Visible Analyst and Visio names are:

Computer System—Unnormalized
Computer System—First Normal Form

2. Use Microsoft Visio or Visible Analyst to view the entity-relationship diagram for the computer
system. Double click on the entities to view the repository information (in both Microsoft Visio
and Visible Analyst). The diagram name is COMPUTER.

The diagram is illustrated in the text. The Visible Analyst and Visio name is:

Computer System

3. Add the VENDOR entity to the diagram. The vendor warrants the computers, and the
relationship between VENDOR and COMPUTER is that one VENDOR can warrant many
COMPUTER(s). Add primary keys. Microsoft Visio will automatically create foreign keys. In
Visible Analyst, select Key Synchronization from the Repository menu.

The diagram is illustrated below. The Visible Analyst and Visio name is:

Computer System with Vendor

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-26

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-27

4. Add the MAINTENANCE entity to the diagram. Maintenance repairs are performed on
computers, and the relationship between MAINTENANCE and COMPUTER(s) is such that one
COMPUTER may have many MAINTENANCE records. Use the repository to define
MAINTENANCE ORDER NUMBER. Set this attribute as the primary key for MAINTENANCE
entity and generate the foreign key.

The diagram is illustrated below. The Visible Analyst and Visio name is:

Computer System with Maintenance

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-28

5. Describe the SOFTWARE CATEGORY entity in the repository. Include the elements found on the
entity-relationship diagram below SOFTWARE CATEGORY in the Composition area.

The Software Category entity is listed below:

Software Category Attributive Entity


Description:
Contains information about the category of software.
Composition:
[PK]Software Category Code +
Software Category Description

6. Describe the MAINTENANCE entity in the repository. The elements are as follows:

a. MAINTENANCE ORDER NUMBER


b. HARDWARE INVENTORY NUMBER
c. MAINTENANCE DATE
d. TYPE OF MAINTENANCE
e. COST OF MAINTENANCE
f. MAINTENANCE COVERED BY WARRANTY

Maintenance Entity
Description:
Describes maintenance work done on a computer.
Composition:
[PK]Maintenance Order Number +
[FK]Hardware Inventory Number +
Maintenance Date +
Type of Maintenance +
Cost of Maintenance +
Maintenance Covered By Warranty
Foreign Key(s):
Computer “Have Periodic” Maintenance
Hardware Inventory Number -> Hardware Inventory Number
On Delete Restrict
On Update Restrict
On Insert of Child Row Restrict

7. Describe the VENDOR entity. The elements are as follows:

a. VENDOR NUMBER
b. VENDOR NAME
c. STREET
d. CITY
e. STATE

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Systems Analysis and Design Instructor’s Manual 13-29

f. ZIP CODE
g. TELEPHONE NUMBER
h. DATE LAST ORDER SENT
i. TOTAL AMOUNT PURCHASED FROM VENDOR
j. TOTAL NUMBER OF ORDERS SENT TO VENDOR

Vendor Entity
Description:
A company that supplies us with either hardware, software, or supplies.
Composition:
Vendor Number +
Vendor Name +
Street +
City +
State +
Zip Code+
Telephone Number +
Date Last Order Sent +
Total Amount Purchased From Vendor +
Total Number Of Orders Sent To Vendor
[FK] Hardware Inventory Number
Foreign Key(s):
Computer “Warranted By” Vendor
Hardware Inventory Number -> Hardware Inventory Number

8. Each computer may have more than one operating system, and each operating system may be
installed on more than one computer. Add an associative entity called COMPUTER
OPERATING SYSTEM between COMPUTER and OPERATING SYSTEM. Include the primary
and foreign keys in the repository in either Microsoft Visio or Visible Analyst.

The diagram is called Computer System with Operating System in both Visible Analyst and Visio
and is illustrated below.

Copyright © 2014 Pearson Education, Inc.


Chapter 13 Designing Databases 13-30

9. Explain in a paragraph the relationship between a foreign key and a primary key, and why it is
necessary to have them on separate entities when there is a relationship between the entities.

A foreign key on one file is the primary key of another file and is necessary because it provides a
means of reading the second matching file (containing the primary key) when a record has been
read on the first file (containing the foreign key).

Copyright © 2014 Pearson Education, Inc.

You might also like