Вы находитесь на странице: 1из 5

IS 475/675 HW #2

Bring two copies of your homework to class one to turn in for grading, and one for notes during class.
You will turn in the grading copy at the beginning of class and then use the other copy as a reference
during class. This assignment should be turned in on paper.

Create a logical ERD for each of the problems below using the crowsfoot notation discussed in class. Be
sure that each entity has the entity name at the top of the box, the primary key attribute or attributes in the
middle of the box, and the non-key attributes in the bottom of the box. Lines should separate each part of
the entity box. The ERD should not include any M:N relationships and all attributes should be placed
within an entity. Each entity must have a primary key defined. A primary key may consist of one of
more attributes. Each relationship should have at least one relationship verb or verb phrase. Please
include all required foreign keys and denote the foreign key(s) with the notation (FK) on the ERD. I
recommend that you NOT use Visio for this assignment but do make the diagrams readable.

1. Design a database for ProLearning, a company that provides training services. ProLearning plans
to use this database to keep track of: customers and potential customers, trainers, training offered and
training categories, scheduled training, and expenses related to a specific training event. Sample data for
ProLearning is provided in the Excel workbook called ProLearningTrainingData available on
WebCampus. Each row in the worksheet represents one training class (called a training event)
conducted by ProLearning. Here are some business rules about the sample data:
A customer has only one address and phone number.
The hourly price of training is related to the Training Type. In other words, the hourly price does not
change if different trainers conduct the same course.
The training expenses and travel expenses fluctuate. They depend on when a specific training event
occurs. For example in the sample data, the training expenses for Beginning MS Access Development
were $250 for one training event while they were $85 for a different offering of that same course.
The hourly rate paid to a trainer is related to a trainer. A trainer only has one hourly rate.
If the end training date is null, then the training event has not yet occurred. ProLearning plans to use this
database to schedule training.
The training category is related to the training. The company keeps track of only one category per
specific type of training class.

Only for question #1 of the assignment create sample data tables for your final data model showing how
all the data in ProLearningTrainingData will be stored among your newly designed tables.
2. Use the business rules below to identify and write all appropriate relationships and cardinalities
between the entities shown on the next page. Also include primary keys and foreign keys for each entity.
Do not add any entities to the diagram. The data model shown on the next page depicts the entities
required for a customer ordering system at a pizza restaurant. A few of the attributes and primary keys
have been included on this model to get you started. Note: it is possible to have more than one
relationship between two entities.

This system accepts orders from customers for such menu items as pizza, ravioli, calzones, etc. This is a
take-out or eat in restaurant. The restaurant keeps customer information in order to make deliveries of
orders to the customer's home (or business).
a. An order is placed by only one customer. A customer is capable of placing many orders.
b. A customer is kept in the system whether or not an order for that customer is currently part of
the system.
c. An employee accepts an order that is placed by a customer. An employee may accept zero or
many orders, but an order is accepted by only one employee. It is possible that an order is
placed directly by a customer over the phone but the customer and employee information is
still related to that order.
d. An employee delivers the order if the order is supposed to be delivered. An employee may
deliver zero or many orders. The employee who accepts the order may or may not be the
employee who delivers the order. The company wants to keep track of the employee who
delivers an order.
e. A menu item is an item such as a pizza or an order of ravioli. An order may have more than
one menu item and each menu item may be on more than one order, so the intersection
between the two is an orderline. An order has at least one order line and may possibly have
many order lines. An order line is composed of one and only one menu item. A given menu
item may be on many order lines.
f. A menu item is made up of one or more ingredients. A menu item must use at least one
ingredient.
g. An ingredient can be used in more than one menu item. An ingredient must be used on at least
one menu item to be considered part of the system.
Customer

Order OrderLine MenuItem


PK menuitemID

quantityordered description
price

Employee
PK employeeID

name

ItemIngredient
Ingredient

quantityrequired
3. Design a database for the owners of a store called Antiques Pasadena. Antiques
Pasadena buys and sells one-of-a-kind antiques of all kinds (examples: furniture, jewelry, china,
clothing and paintings). An ItemNumber uniquely identifies each item, but no two items are alike
in the store, so this is not a standard inventory application. In a standard inventory application,
the database designer assumes that there will be more than one of a given item in inventory and
keeps track of the quantity on hand of that item; in this application, the designer must assume
that each ItemNumber represents a unique item and that the quantity on hand will be 1. The
owners of Antiques Pasadena decide what composes an item. For example, the owners may
decide that a single spoon is an item or they might decide that an entire silver place setting is
an item. This decision is made when the item is purchased and made available for sale in the
store. This decision does not change once it has been made. Each item is also characterized by a
Description, AskingPrice, InitialCondition, and open-ended Comments about the item.

The owners of Antiques Pasadena work with many different individuals, called Clients, who sell
items to and buy items from the store. Some clients only sell items to Antiques Pasadena, some
only buy items from Antiques Pasadena and some both sell and buy. A client is identified by a
ClientID and is also described by a ClientName and PhoneNumber. The owners aren't planning
on keeping track of whether a client is a buyer or a seller in the actual Client data. When
Antiques Pasadena sells an item in stock to a client, the owners want to record information about
the sale such as the actual selling price, sales tax, date sold, and commission paid. When
Antiques Pasadena buys an item from a client, the owners want to record the purchase cost, date
purchased, and condition at the time of purchase.
4. Create a database for a company that delivers videos via mail to customers and provides
streaming content (a company such as Netflix). While the customer delivery database for Netflix would
be quite complex, we are going to design just one small part of it the customer viewing list and DVD
queue. This database should keep track of the data required in the columns shown in the Excel Workbook
VideoList.xlsx. The worksheet in this workbook (VideoList) contains the data stored for customers
video list also called a queue for the DVD delivery part of the application. The video list contains
videos that customers want to receive, have received, or have already received and returned. In addition,
the list also keeps track of those videos that have been streamed by a customer. A customer of any type is
able to stream video content. Sample data is provided in the worksheet to help you understand what
needs to be stored for this application. The sample data is brief to limit the complexity of the design.
Here is some additional information about the application:

A customer can be of only one customer type at a time. A customer is categorized by type.
A customer creates a queue to keep track of what videos he/she wants to receive in the mail. Most
customers have 20-30 videos in their queue at any point in time.
The data values for the status of a video in the queue for a given customer can be as follows:
o Queue: A video is prioritized and waiting in the customer queue until it moves up the queue
and is ready to be sent by the company. Each video that has a status of queue must have a
number attached. For example, a video for a customer that has a status of Queue-1 means that
it is the first video in the queue.
o Returned: A video has been sent to the customer and was returned by the customer.
o Home: A video that is currently in the possession of a customer. A customer may keep a video
as long as he/she wants, but customers are only allowed a pre-determined number of videos.
This database does not keep track of how many videos a customer is allowed to keep at home;
this database only keeps track of the status of videos in a customers list of videos.
o Saved: A video that is not yet released and available for customer use is tracked with a status of
Saved. Any saved videos must be prioritized with a number. For example, a video with a
status of Saved-1 means that it is the first video in the Saved category for that customer. For
example, Customer ID 1234 in the sample data has "The Accidental Tourist in queue with the
status of Saved-1.
o Watched: A video that has been streamed and watched is noted with this status. If a video has
been streamed and watched, the date that it was watched is stored in the "date video returned"
column.
Data in the sample worksheet labeled as null means that the data was not available at that time due
to the status of the video. Null data is non-existent. For example, the status of the video
Divergent for customerID 1234 indicates that the video is third in the queue waiting to be sent to
the customer. Thus, the movie has not yet been sent or returned, so the date that the movie was sent
does not exist and the date that it was returned does not exist.
Assume each video has only one video category.
Assume that there is a group of pre-defined video categories that must be stored in the database.
Assume that a customer video rating is an integer and can go from 0 to 5. Assume that it is possible
to calculate an average video rating from data in the database. (hint: Any data that can be calculated
("or derived") from the existing data does not have to be stored in the database.)
Assume that it is possible for a customers video rating to be non-existent (null). A customer must
enter his/her rating for a particular video. A customer is allowed to enter a video rating for a movie
only once there is no time dependent data for a video rating so if a customer enters a new rating
it is an update operation rather than an insert operation.

Remember that it is not your job to design any processing for this system. It is not your job to figure out
how many videos a customer can have in his/her possession and ensure that the customer has only that
quantity of videos. It is not your job to move videos in status from saved to queue when a video
becomes available. Your job is to figure out how to store the data with a design that does not contain
redundant data. Just design the data storage blueprint, i.e. ERD.

Вам также может понравиться