Professional Documents
Culture Documents
Practice of ER Modeling: Yong Choi School of Business Csub
Practice of ER Modeling: Yong Choi School of Business Csub
Practice of ER Modeling: Yong Choi School of Business Csub
Yong Choi
School of Business
CSUB
Practice 1
A department hires many employees. A
employee is hired by one department.
Dept (one) ------------ Employee (many)
Entity naming!
Video store (optional) --- Video Tape (many, optional)
Practice 9 – Multiple Entities
A college runs many classes. Each class may be
taught by several professors. A particular class may
always uses the same room. Because classes may
held at different times or on different evenings, it is
possible that each room is used by many different
classes. By the way, A professor can teach several
classes.
Professor (many, optional) ---- class (many, optional)
Class (many, optional) ---- room (one, optional)
Practice 10 – Multiple Entities
There are several departments in School of Business
and Public Administration at CSUB (indication that
cardinality from school to Dept is many). Each
department belongs to one school. A department has
many professors, but a professor may belong to more
than one department. Similarly, courses may be
offered by several departments and a department
must have at least one course. A professor may
teach more than one student, and a student may
have more than one professor.
Practice 10 - answer
Course
School Department
Student Professor
Practice 11 – Multiple Entities
Each employee in an engineering company has one
recognized skill (e.g., mechanic, electrician), but a
given skill may be possessed by several employees.
An employee must be able to operate a given
machine-type (e.g., milling machine, grinder). If any
employee has one of several skills, each skill must be
associated with the operation of only one machine
type. Possession of a given skill (e.g., mechanic,
electrician) allows an employee to maintain several
machine-types. On the other hand, maintenance of
any given machine-type requires a specific skill (e.g.,
a milling machine must be maintained by a
mechanic).
Practice 11 - answer
Emp Skill
Dept
Emp
Practice 13-1
Read the following case study, which describes
the data requirements for a video rental
company: The video rental company has several
branches throughout the USA. The data held on each
branch is the branch address made up of street, city,
state, and zip code, and the telephone number. Each
branch is given a branch number, which is unique
throughout the company. Each branch is allocated
staff, which includes a Manager. The Manager is
responsible for the day-today running of a given
branch. The data held on a member of staff is his or
her name, position, and salary.
Practice 13-2
Each member of staff is given a staff number, which
is unique throughout the company. Each branch has
a stock of videos. The data held on a video is the
catalog number, video number, title, category, daily
rental, cost, status, and the names of the main
actors, and the director. The catalog number
uniquely identifies each video. However, in most
cases, there are several copies of each video at a
branch, and the individual copies are identified
using the video number. A video is given a category
such as Action, Adult, Children, Drama, Horror, or
Sci-Fi. The status indicates whether a specific copy
of a video is available for rent.
Practice 13-3
Before hiring a video from the company, a customer
must first register as a member of a local branch. The
data held on a member is the first and last name,
address, and the date that the member registered at
a branch. Each member is given a member number,
which is unique throughout all branches of the
company. Once registered, a member is free to rent
videos, up to maximum of ten at any one time. The
data held on each video rented is the rental number,
the full name and number of the member, the video
number, title, and daily rental, and the dates the video
is rented out and date returned. The rental number is
unique throughout the company.
Real World Example 1
NCFCComp would like to keep track of their employees, departments and
projects. The company is organized into departments. Each department
has a unique name, a unique number and a particular employee who
manages the department. We keep track of the start date when that
employee began managing the department. A department may have
several locations. A department controls a number of projects, each of
which has a unique name, a unique number and a single location. We
need to store each employee's name, social security number, address,
salary, sex, and birth date. An employee is assigned to one department
but may work on several projects, which are not necessarily controlled by
the same department. We need to keep track of the number of hours per
week that an employee works on each project. We also should keep track
of the direct supervisor of each employee. For insurance purposes, we
want to keep track of the dependents of each employee. We keep each
dependent's name, sex, birth date, and relationship to employee.
Real World Example 2
Direct Health Center (DHC) would like to hire you as consultant to
design a database for their medical center that employs several
physicians. Each physician has only one specialty. Patient records are
shared among the doctors. For each patient visit information is stored
about the type (regular office, hospital, after hours, house calls, etc.), a
single diagnosis for that visit, and the charge. A patient may visit more
than one of the doctors on a particular day. We assume, however, that a
patient never visits the same doctor more than once in one day. On each
doctor we would like to store his/her employee number (which is
unique), his/her full name and the doctor's specialty. For every patient
we would like to store his/her SSN, full name, age and
his/her diagnosis. If and when a patient is prescribed any medication,
we need to know the name of that medication, its dosage and who
prescribed it.
Real World Example 3