13
Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice of ER modeling - Answer Yong Choi School of Business CSUB

Embed Size (px)

Citation preview

Page 1: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice of ER modeling - Answer

Yong Choi

School of Business

CSUB

Page 2: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 1

A department hires many employees. Each employee is hired by one department.

Each manager manages one department. A department is managed by one manager.

Page 3: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 2

An author writes many books. Each book is written by many authors.

A team consists of many players. A player plays for only one team.

Page 4: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 3

A part-time lecturer teaches one course. A course is taught by exactly one part-time lecturer.

A flight-hub connects several airports. An airport is used by many flight-hubs.

Page 5: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 4

A purchase order may be for many products. A product may appear on many purchase orders.

A customer may submit many orders. An order is for exactly one customer.

Page 6: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 5

Refine business rules (BR) A college has a large number of professors. Each

professor may belong to one or several colleges in one university. In some cases, a professor may not belong to any college at all.

Page 7: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 6 (develop BR) Eliminate unnecessary information and refine BR The California State University has changed one of

the policies. It is about course schedule changes based upon feedback from professors and students. One of the changed policies is that a course may have one or more scheduled sections, or may not have a scheduled section at all. Each section has one course or may not have any course at all.

Page 8: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 7

Eliminate unnecessary information and refine BR According to the policy of the California Hospital, a

patient must have a patient record. In other words, each patient may have one or more records. Each patient record must belong to exactly one patient.

Page 9: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 8

Since the growth rate of the California video store is very fast, the store has decided to change the inventory management policy. One of the policy is that a video store may stock more than one copy of a given movie and only one copy of a given movie can belong to one video store.

Page 10: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 9 – Multiple Entities

CSUB is the only 4 years comprehensive university in Kern County. Each class offered by CSUB may be taught by several professors. A particular class may use a classroom. Because classes may held at different times or on different evenings, it is possible that each classroom can be used by many different classes. By the way, A professor can teach several classes.

Page 11: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 10 – Multiple Entities

There are several departments in each school at CSUB. 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.

Page 12: Practice of ER modeling - Answer Yong Choi School of Business CSUB

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).

Page 13: Practice of ER modeling - Answer Yong Choi School of Business CSUB

Practice 12 – Recursive Relationship In our company, we have several departments with more than

1000 employees. Each department is managed by one person, and must have a manager all the time by our corporate regulations. We would like to keep the following information on each department: department ID, department name, budget, and location. Each employee is supervised directly by one person, but each supervisor can manage many supervisees. As for employees, we would like to keep the following information: employee id, employee name, address, salary. Since data management of our company is becoming so complex, we plan to develop a database system to manage our current data requirements described here.