Sei sulla pagina 1di 5

G51DBS LAB 1: ER DIAGRAM

SAMPLE ANSWER Based on Crows Foot Model


Question 1
Which of the following are likely to be entities? 1. Customer, 2. Computer sales tax 3. Height 4. Product 5. Tomato 6. Religion 7. Temperature 8. edit transaction 9. manufactured part 10. map 11. ASCII character

Answer
1. Customer Yes. 2. Computer sales tax does not have occurrences which are distinguishable by attributes. It is an imperative statement. 3. Height does not have attributes. It takes numerical values, therefore, is an attribute. 4. Product Yes. 5. Tomato could be an entity if we are concerned with keep data about distinguishable tomatoes. But it is more likely to be an occurrence of another more general entity like FRUIT or PRODUCT 6. Religion - could be an entity if we are concerned with keep data about many different religions. However, it is more likely to be an attribute of entity PERSON. 7. Temperature - can take numerical values, therefore, is an attribute. 8. edit transaction is an imperative statement 9. manufactured part Yes. 10. map as with Tomato and Region 11. ASCII character - can take numerical values, therefore, is an attribute.

G51DBS LAB 1: ER DIAGRAM

Question 2
Which of the following are likely to be relationships? 1. 2. 3. 4. 5. 6. purchases customer belongs to weight produces sales tax computation

Answer
1. 2. 3. 4. 5. purchases yes, describing association between a Customer and Product. customer is a noun describing an entity. belongs to yes, describing association between a Person and Item. weight is an attribute. produces is most likely procedural. However, if we want to keep records of which factory worker produces which manufactured item, Produces would be a valid relationship. 6. sales tax computation a procedure.

Question 3
Draw ER diagrams for the following Business Rules, showing Entities, Relationships and Cardinality. 1. A department has many employees An employee works in only one department. 2. A mother may have many children. A child has one mother. 3. Each student attends several classes. There are several students in each class. 4. An author can write many books. A book may be written by many authors. 5. A purchase-order may be for many products. A product may appear on many purchase-orders. 6. A player plays for only one team. A team consists of many players. 7. A manager manages at most one department. A department is managed by at most one manager.

G51DBS LAB 1: ER DIAGRAM

Answer
1. 2. 3. 4.
Dept Mother Student Employee Child Class

Author

Book

5. 6. 7.

P Order Team Manager

Product Player Dept

Question 4
Pick and Shovel Construction Company is a multi-state building contractor specializing in medium-priced town homes. Assume that Pick and Shovels main entities are its customers, employees, projects and equipment. A customer can hire the company for more than one project, and employees sometimes work on more than one project at a time. Equipment, however, is assigned to only one project at a time. Draw an ERD showing those entities.

Answer

CUSTOMER

PROJECT

EQUIPMENT

EMPLOYEE

G51DBS LAB 1: ER DIAGRAM

Question 5
A university consists of a number of departments. Each department offers several courses. A number of modules make up each course. Students enrol in a particular course and take modules towards the completion of that course. Each module is taught by a lecturer from the appropriate department, and each lecturer tutors a group of students. Draw an ERD showing the description above.

Answer
DEPARTMENT

COURSE

MODULE

LECTURER

STUDENT

Question 6
The KwikTite Corporation operates many factories. Each factory is located in a region. Each region can be home to many of KwikTites factories. Each factory employs many employees, but each of those employees is employed by only one factory. Draw an ERD showing the description above.

Answer
EMPLOYEE Remember that a 1:M relationship is always read from the 1 side to the M side. Therefore, the relationship between FACTORY and REGION is properly read as factory employs employee.

REGION

FACTORY

G51DBS LAB 1: ER DIAGRAM

Question 7
A college runs many evening classes. Each class may be taught by several teachers, and a teacher may teach several classes. A particular class always uses the same room. Because classes may meet at different times or on different evenings it is possible for different classes to share a room. a) Draw an entity-relationship type diagram showing the entity types Teacher, Class, Room, and the relationship types Teacher-Class and Room-Class.

Answer

TEACHER

CLASS

ROOM

b) Redraw your type diagram, decomposing any many:many relationships into 1: many relationships.

Answer

TEACHER

TEACHER CLASS

CLASS

ROOM

G51DBS LAB 1: ER DIAGRAM

Potrebbero piacerti anche