Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Practice Problem 1

For the business rules given below, identify the following:


1. Entities
2. Attributes (3-5 per entity)
3. Relationship type (1:1, 1:M, M:N)
4. Explain your answers
Given business rules:
Scenario 1: A customer may have many cars. Each car belongs to only one customer.
Scenario 2: A student may take many classes. Each class may have many students enrolled.
Scenario 3: Each department is managed by one employee. Each of those managers can manage
only one department at a time.
1. Entities

Scenario 1 : There are 2 entities here, Customer – which represents all given data
available about the customer and then some about the given customer like name, birthday
etc. and Car which shows the information about the Car

Scenario 2 : The two entities are Class and Student. Class can have all the information
regarding the given

Scenario 3 : Department, Manager are the two entities of this scenario.

2. Attributes
Scenario 1 :
CUSTOMER Entity
 Customer ID (Primary Key)
 Customer Name
 Customer SSN
 Customer Date of Birth
CAR Entity
 Car Type
 Car Make
 Car Colour
 Car Miles Covered
Scenario 2 :
STUDENT Entity
 Student Name (Primary Key)
 Student ID
 GPA
 Academic Standing
CLASS Entity
 Class ID (Primary Key)
 Class Course Number
 Class Professor
Scenario 3 :
DEPARTMENT Entity
 Department ID (Primary Key)
 Department Name
 Department Floor
MANAGER Entity
 Manager ID (Primary Key)
 Manager Experience
 Manager Domain

3. Relationship Type
Scenario 1 : One customer can have any number of cars. 1:M is the relationship that’s the
most prevalent here. One car can only belong to one person.

Scenario 2 : Many Students go to classes; Many Classes have many students. This is one
of the trends for all classes, the M:N Relationship is followed through this.

Scenario 3 : One Department can have only One Manager; One Manager can manage a
department only. The 1:1 relationship stands.

Practice Problems 2

Come up with business rules for the scenarios given below:


Scenario 1: Business rules define two entities and one 1:M relationship.
Scenario 2: Business rules define two entities and one 1:1 relationship.
Scenario 3: Business rules define two entities and one M:N relationship.

For each scenario, clearly identify the following:


- Business rules that define two entities and describe a relationship in both directions
- Entities Relationship type
- Justification of the chosen relationship type (use complete, coherent sentences!)

Scenario 1 :
Business Rules : A painter creates many different paintings, but each painting is only made by
one painter
Entities : Two entities are Painter and Paintings, these are the two entities which tell us about the
Painter, who has attributes like age, experience etc and Painting has attributes like type of paint,
painting type and so on.
Relationship : One to Many Relationship because one record in the table can have an association
with one or more records in another table.
Scenario 2 :
Business Rules : A retail company’s policy may require that each store be managed by a single
employee.
Entities : Company and the Employee are the two given entities; the employee table will have all
the employee details and the Company will have company establishments.
Relationship : One to One, here the company has a store which must be managed by just one
employee that’s how it’s 1:1.
Scenario 3 :
Business Rules : Intern has skills and skills can be learnt by all interns.
Entities : Intern and skills are entities which are really true for all kinds of interns. The interns
have details like college year, major, minor etc. and the skills are C, C++, Java etc.
Relationship : All Interns have some job skills; some job skills can be learnt by any of the intern.
This is a M : N kind of a relationship.
Practice Problem 3
Using the business rules provided below, list all the entities and identify each relationship type
among the entities.
Business rules are defined as follows:
- A painter can paint many paintings. Each painting is painted by only one painter.
- A gallery can exhibit many paintings. Each painting is exhibited in only one gallery.
- A painter can exhibit paintings at more than one gallery at a time.
Entities :
Painter
Attributes
- Name
- Experience
- Expertise
- Knowledge
Painting
Attributes
- ID
- Painting Type
- Painting Cost
- Painting Thought
Gallery
Attributes
- ID
- Location
- Type
- Name
Relationship :

1. Painter can have many paintings but one painting can be by only one painter which
makes it a 1 : M Relationship.
2. Paintings can be exhibit in more than one gallery and one gallery have one painting
which means it is a 1 : M Relationship Painter : Gallery
3. Painters can have multiple paintings at multiple galleries over time and all galleries
have many paintings which means this is a M : N Relationship.
Practice Problem 4
Draw the Entity-Relationship diagram developed in Practice Problem 3 using MS Visio. Make
sure to include all entities, attributes and relationships.

You might also like