Database Design - Section 2: Instructor Guide
Database Design - Section 2: Instructor Guide
Database Design - Section 2: Instructor Guide
Instructor Guide
Table of Contents
Lesson Preparation
This lesson begins the actual data-modeling content. Before jumping into definitions of
attributes and entities, we first want students to understand the concept of modeling and to
recognize models -- conceptual vs. physical. This lesson provides reasons for creating a data
model in the first place, as opposed to just going ahead and building a database.
You may want to ask students, “Have you ever had trouble finding a document in a filing
cabinet or folder that someone else organized? The files may have been organized to meet their
needs, but not your own.”
Data modeling attempts to capture the needs of the business users so that the resulting database
is one that everyone can use easily.
What to Watch For
No additional teaching information for this page.
Connections
None at this point -- this is the first chapter that actually talks about data modeling.
Tell Me / Show Me
Tell Me / Show Me
Play the animation and then ask the class:
• What is the problem in this animation?
• What could have been done to make this easier?
• Who should do things differently, the chef or the customer?
Feel free to replay and pause the animation if it helps the class discussion.
Key responses would include:
The chef should have asked more questions before preparing the sandwiches because he is the
one who needs to do all of the work!
The woman should have a better-defined order.
Tell Me / Show Me
Tell Me / Show Me
You can explain the graphics if necessary:
In the first one, the boy is thinking of getting a nice sports car but is given a practical car
instead.
In the second one, the girl is expecting a big bouquet of flowers but gets something
considerably smaller.
Tell Me / Show Me
Tell Me / Show Me
This animation is similar to the one at the beginning of the lesson, but this time, the customer
specifies what she wants from the start.
The chef is able to execute the order perfectly. No time is wasted and everyone is happy.
You may want to ask students how could the same result be achieved?
Answer: The chef could have questioned the customer until he knew exactly what she wanted.
If there was an employee manual specifying how to take an order, there would have been a
complete order given to the chef by an “order taker.”
Try It / Solve It
Try It / Solve It
The objective of the dream-house activity is for students to demonstrate precise
communication as a means to facilitate discussion and prevent mistakes and
misunderstandings.
Form student groups of two and explain the directions to the class: Working in pairs, one
student describes his/her "dream house" while the other student attempts to draw it. The pairs
can discuss specific details, but the student describing the house is not allowed to see what is
being drawn until after time is called.
Assessment:
Collect student drawings and tape to the board/wall.
Ask volunteer student pairs to describe the discrepancies between what they thought was being
described and what was actually drawn.
Solicit student ideas on how they would improve the communication process if they were to do
the same activity again.
Possible answers may include: Describe shapes and colors. Describe relative sizes (bigger than
a hut, smaller than a hotel, etc.) Be specific (2 doors, 3 stories, 5 windows, etc.). Make
comparisons to known things (similar to Mary’s house, like a castle, etc.).
Lesson Preparation
No further lesson preparation information.
What to Watch For
Other ways to test understanding:
Give additional examples of entities (SHOPPING MALL, MOVIE STAR, SHOE) and ask
them to name instances of each.
This will help you determine if they can distinguish between the two.
Connections
Recall the Dream House activity in Lesson 1. Identify the entities versus the instances there.
Some examples of entities and instances (Note that this is not an exhaustive list.):
Tell Me / Show Me
Tell Me / Show Me
Pass magazine ads around the class and/or look at commercial websites.
Some suggestions are:
• nike.com - sports equipment
• weyl.nl - beef industry
• en-tranz.com - entertainment
• carmax.com - used cars
• hallmark.com - greeting cards
• sephora.com - beauty products
• telstra.com - communication
• changan.com.cn - automobiles
Ask students to identify the “main thing” about the ads or sites. They will usually come up
with a list of entities and instances. Define entities and distinguish them from instances with
examples. For example, if you use the Nike website/business with your class, make sure that
they see the difference between the entity FOOTWEAR and the instance of the entity as Nike
Shoe (or other shoe style).
Tell Me / Show Me
Tell Me / Show Me
Tell Me / Show Me
A Dalmatian, a Siamese cat, a cow, and a pig are instances of ANIMAL.
A convertible, a sedan, and a station wagon are instances of CAR.
There are many entities.
Some entities have many instances; some have only a few.
Entities can be:
• Tangible, like PERSON or PRODUCT
• Nontangible, like SKILL LEVEL
• An event, like CONCERT
Try It / Solve It
Try It / Solve It
Activity: The Student Entity
It is useful to engage the students physically at this point -- so this activity will have them
stand and sit. The activity is designed to help them distinguish between entities and attributes.
In this case, the entity STUDENT and an instance of STUDENT (e.g., Julie Miller).
Say, “STUDENTS please stand up.” Have everyone sit down and then say, “Julie Miller (or
some specific student in your class), please stand up.”
Then explain that while they are all students, Julie Miller is a specific instance of STUDENT.
Have students write on a 3 x 5 note card the answers to the questions below, or fill out a
preprinted sheet of paper with the following information:
• Month of birthday
• Color of shirt/blouse
• Shoe color
• Color of backpack/school bag
• Glasses/no glasses
• Year in school
Try It / Solve It
Try It / Solve It
Get the discussion started by asking students about the last time they went to the salon,
barbershop, etc. What did they have done? What are the main things about a haircutters’
business (possible answers would be customers, services, technicians, employees, products,
tools, etc.). You will write their entity suggestions on the board. After this, have them give
instances for each entity named:
• Customer – Vishal Gupta
• Services – color, cut, permanent wave, manicure, shampoo
• Employees/technicians – stylist, shampoo person, cashier, receptionist
• Products – shampoo, color, styling gel, lotion
• Tools – hair dryer, scissors
Note: In naming entities, the class may also be including attributes. If they do this, correct
them, and identify them as attributes, and tell them that we will discuss the difference more in
the next lesson.
Lesson Preparation
In this lesson, we will start discussing the data model for a DJ (disc jockey) business.
This is an example business scenario and model that will recur throughout the content.
This consistent topic will help the students to learn data-modeling concepts.
No diagram will be shown in this lesson; we just want the students to start thinking about the
business.
What to Watch For
Make sure they can distinguish between entities and attributes.
Is the attribute single-valued? If not, then it’s an entity. (Use example of CLASS and
STUDENT, where there are many students in one class.)
Tell Me / Show Me
Tell Me / Show Me
An attribute is a piece of information that in some way describes an entity. An attribute is a
property of the entity, a small detail about the entity.
Entities Have Attributes
For now, tell students to assume that all entities have at least one attribute. Later, we will
discover exceptions to this assumption. Usually, there are many attributes for an entity, but
again, we are interested only in those attributes that are of importance to the business..
Tell Me / Show Me
Tell Me / Show Me
Attributes:
Point out that the only attributes they need to model are those that the business cares to track.
So for example, you may want to track shoe size as an attribute of customer if you are a shoe
store, but maybe not if you are a grocery store. It all depends on the business requirements.
Every attribute has a data type. For example, the attribute “name” would be of a data type like
character string, the attribute “salary” would have a number data type, and the attribute
“photograph” would likely be of an image data type.
Attribute Is Single-Valued
An attribute for an entity must be single-valued. In more precise terms, an entity instance can
have only one value for that attribute at any point in time. This is the most important
characteristic of an attribute. The attribute value, however, may change over time.
For example: The entity CAR may have attributes “model” and “color.” There can be only one
value for these (for example, "beetle" and "green") at one time. Although model stays constant
over the lifetime of the car, color could change.
Tell Me / Show Me
Tell Me / Show Me
Have students talk about their favorite DJs and what makes them so good. DJs have to know a
lot about music. Talk about the SONG entity, which is the collection of songs and
soundtracks. Ask class to give attributes that describe it and values for each attribute.
Possible answers would be title (here they could name their favorite songs), composer, date
released/composed, duration, and artist (this one is potentially multivalued, as several artists
could perform the same song. Provide the business assumption that each artist’s version is
considered a different performance of that song, and we will define it as a different instance in
the SONG entity. After all, when you request a song, you often also have a specific artist’s
version in mind).
Then point out attributes that are mandatory (such as a title) and some that are optional (such as
the date it was released). Explain that release date is a better attribute than age because it is less
volatile.
Note: The DJ Business scenario is introduced in its entirety in the next lesson.
Tell Me / Show Me
Tell Me / Show Me
When picking a unique identifer for SONG, have students recall the Student Entity activity
from the previous lesson. What combination of traits finally resulted in just one student? Then
ask if there is a simpler way to find a specific student -- perhaps a student number or ID? (Most
schools assign one to each student.)
Ask the class if title would be sufficient to uniquely identify a SONG.
Answer: No, because there are cases of songs with the same title.
Would a combination of attributes work? Probably. (Example: title and composer and artist.)
Could you decide to just assign a unique ID to each SONG, similar to Student number? Yes.
Try It / Solve It
Try It / Solve It
Assessment:
In order to guide students in the direction of the given solution, you may want to provide
business contexts for each concept, such as:
• Vehicle (a car-rental agency)
• Diet Coke (a restaurant)
• Price (a department store)
• Customer number (an online catalog)
• Green (a botanical garden)
• Cookie (a restaurant)
Please note that the solution given here is one of many possibilities. If students give different
answers, encourage class discussion about their responses. For example: Vehicle is most likely
an entity in a car-rental business. You can have a list of vehicles (an entity is something you
can make a list of items for). Each item on the list would be an instance of the entity (such as
convertible, sports utility, sedan, coupe). Vehicle would probably not be an attribute because
there would be many values for a vehicle (remind them that attributes are single-valued). Could
Try It / Solve It
Try It / Solve It
Assessment:
Try It / Solve It
Try It / Solve It
Assessment:
Entity: STUDENT
Attributes: student ID, first name, last name, address
UID: student ID
Entity: MOVIE
Attributes: title, date released, producer, director
UID: a combination of title and date released, or an artificial UID such as movie ID
Entity: LOCKER
Attributes: size, location, number
UID: number
Lesson Preparation
No further lesson preparation information.
What to Watch For
Make sure that information is stored only once -- the same attribute should not be repeated in
another entity if it is describing the same information. For example: price can be an attribute of
FOOD ITEM, but total price of an ORDER can be derived so it should not be an attribute
there.
Assess for understanding by asking students if entities change depending on the type of
database, computer, or programming language used. Answer: No. This is what is meant when
we say that data modeling is “implementation-free.”
Tell Me / Show Me
Tell Me / Show Me
Database Types: Hierarchical, Relational, Network
This picture shows us that an ER model captures business information that can be used as a
basis for any database. The ER model tells us something about the business, not about the
implementation. Having said that, in practice, the majority of the ER models lead to relational
database implementations.
Tell Me / Show Me
Tell Me / Show Me
Discussion points using the school-record example:
Where does the school store student information? How is it stored?
Who is responsible for updating changes to student information?
What information indicates that a student is eligible for graduation?
Have you ever updated information only to be asked to do it again?
What happens to student data when the school gets new database computers?
How do you locate your information among all the other student records?
How do your grades not get confused with another student with the same last name?
Tell Me / Show Me
Tell Me / Show Me
You will be showing the ER model to the class as an example of a complete data model. This
will contain supertypes/subtypes, arcs, barred relationships, and other data-modeling
techniques that you have not taught yet. Just explain that by the end of the course, they will
know what it all means. For now, focus on the entity names in softboxes and on the attributes
inside the softbox, which are mandatory (*) and which are optional (o). Point out the
relationships. These are coming up in the next lesson.
Drawing conventions will be discussed in another lesson, so you may not want to use the terms
“softbox” when going over the ERD. You may not even want to go over the drawing
conventions for mandatory and optional attributes (* vs. o), but it is all right if some students
deduce this from your demonstration.
Tell Me / Show Me
Tell Me / Show Me
You will be showing the ER model to the class as an example of a complete data model. This
will contain supertypes/subtypes, arcs, barred relationships, and other data-modeling techniques
that you have not taught yet. Just explain that by the end of the course, they will know what it all
means. For now, focus on the entity names in softboxes and on the attributes inside the softbox,
which are mandatory (*) and which are optional (o). Point out the relationships. These are
coming up in the next lesson.
Drawing conventions will be discussed in another lesson, so you may not want to use the terms
“softbox” when going over the ERD. You may not even want to go over the drawing
conventions for mandatory and optional attributes (* vs. o), but it is all right if some students
deduce this from your demonstration.
Tell Me / Show Me
Tell Me / Show Me
You will be showing the ER model to the class as an example of a complete data model. This
will contain supertypes/subtypes, arcs, barred relationships, and other data-modeling
techniques that you have not taught yet. Just explain that by the end of the course, they will
know what it all means. For now, focus on the entity names in softboxes and on the attributes
inside the softbox, which are mandatory (*) and which are optional (o). Point out the
relationships. These are coming up in the next lesson.
Drawing conventions will be discussed in another lesson, so you may not want to use the terms
“softbox” when going over the ERD. You may not even want to go over the drawing
conventions for mandatory and optional attributes (* vs. o), but it is all right if some students
deduce this from your demonstration.
Try It / Solve It
Try It / Solve It
Try It / Solve It
Activity: The Restaurant
The restaurant ERD and business scenario is a partial version of the progressive project, Global
Fast Foods, which they will be building throughout the course. This is not a definitive solution
for this activity. Other students may want an entity called MENU, with food item as an
attribute. Be careful with this one: although MENU could be a valid entity, food item as an
attribute would be repeating: there would be many different food items on a menu. Therefore,
even with MENU as an entity, you would still need FOOD ITEM as another entity. Attributes
of menu could be name, hours served, etc.
Ask students why they would choose to make an attribute mandatory or optional. This makes
them start thinking about business rules.
Try It / Solve It
Tell Me / Show Me
This is an exercise that asks students to identify and analyze information contained on a printed
report. Throughout the course, they will be looking at “source documents” such as reports,
receipts, notes, etc., and creating data models from them. At this point, we want the students to
start asking the right questions, given a source document.
Assessment:
What is this table about?
It is about food items purchased in a lunch room, most likely in a school.
What data was collected? How often is it collected?
The table shows the count of types of food items (hamburger/taco, pizza, soup/salad)
purchased per day, broken out by faculty sales and student sales. It seems that the data is
collected weekly.
What information does this table provide?
The table gives us information about which items are the most popular.
Lesson Materials
Picture from a Magazine
This should tell a story, but allow you to hold back a piece of the story. For example, if you
choose a scene of a busy street with a man getting splashed by a car driving by, you can hold
onto the piece with part of the man on it. Ultimately, any image will work, but it’s more fun if
it’s a mystery for the students.
Take the 8 1/2 x 11 image and cut it into 16 equal pieces. Divide the class into three
groups/teams. (Note: if the class is larger than 20, you may want to break them into four groups
and have the fourth work as observers. If that is the case, then have the observers follow the
"Observe" directions listed below.) Depending on your time limitations, you also may want to
have them decide on a group name for themselves.
Mix up the pieces of the puzzle and randomly distribute five pieces to each group. This leaves
one piece left over. The instructor should hide this piece in pocket or on desk.
Draw the relationships that represent the ERD.
Scissors
This activity is a small-group communication exercise to be completed in class.
Tell Me / Show Me
Try It / Solve It
Try It / Solve It
Assessment
Debrief the activity. Share with the students your observations (or the observing group).
Examine how the students developed their strategy for providing a solution. Discuss the
communication process and how vital this role is in transforming business requirements into an
operational database. Did the students create their own method for solving the problem? How
is this similar to analyzing business needs?
Try It / Solve It