DBMS ASSIGNMENT

 

 

                           

 

 

                                                                                           

                                                       
SUBMITTED TO
: Mrs. GOONJAN JAIN

                                                                      
SUBMITTED BY : PANKAJ JAISWAL

                                                                                      
( 2K15/MC/050)

  

ENTITY
RELATIONSHIP  MODEL

An entity relationship model is also called an entity-relationship diagram.It is a graphical representation
of entities and their relationships to each other.

The ER model consists of three basic elements: entities, attributes and
relationships.

 

CUSTOMER-ORDER-PRODUCT
ER-MODEL

 

Construction of E-R Diagrams

 

1.     Identify Entities:

 

Modelling the entities is the first
step to create an ER data model.

 

An entity is an
object, event or concept which is usually identified by a single, unique
attribute.

 

Generally, when a data model has an identifier for
a possible entity, it is likely to be the entity. For ex, if there is a field
for customer name or customer number, then the entity relationship data model should
have an entity name CUSTOMER .

Entity

ORDER

CUSTOMER

PRODUCT

 

2.    
Identify attributes:

 

Identify the attributes for each entity.

If the price of a product is constant for all orders, then PRICE is a
function of PRODUCT. If the price of the same product is different for
different orders, then the PRICE is a function of the relationship between
ORDER and PRODUCT.

 

Entity

Attributes

ORDER

ORDER_ID, ORDER_DATE, ORDER_AMOUNT

CUSTOMER

CUSTOMER_ID, CUSTOMER_NAME, CUSTOMER_ADDRESS,
NUMBER

PRODUCT

PRODUCT_ID, DESCRIPTION, PRODUCT_PRICE,
PRODUCT_QUANTITY

 

However, in general all cases are not
so simple and clear. For example, take ADDRESS, maybe a number of attributes for
this candidate entity were identified, like HOUSE_NO, STREET_NO, STATE, ZIP_CODE,
COUNTRY. Does it indicate that ADDRESS is an entity? however, all of these
should be the attributes of CUSTOMER entity.

3.      Choose Primary Keys:

Primary keys must
be chosen for each entity after identifying and modeling each entity and its
attributes.

 

Good Primary Key Properties

1. Entity should be uniquely
identified.

2. Not null (it should always has a
value)

3. Data less needed

4. Never changes it value and
properties

 

Characteristics of a Good Primary Key

4.      Identify the Relationships:

 

Relationships among entities are a
critical part of the Entity Relationship Diagram. When these relationships are
implemented in the database, they provide the links among the various tables
that give the database its flexibility. To maximize the flexibility of a
database, relationships must be properly identified and modeled.

Many relationships are relatively easy to recognize, such as those
between ORDERS and CUSTOMERS, ORDER and CUSTOMER are related, as are ORDER and PRODUCT. However, we
know that there may not necessarily be a relationship between PRODUCT and
CUSTOMER. Because both are related to ORDER we can report which products are
ordered by a particular customer.

5.      Determine Cardinalities:

 

There are both maximum and minimum
cardinalities.

 

ONE TO ONE

ONE TO MANY

MANY TO MANY

EXACTLY ONEONR OR MORE

ZERO OR ONEZERO OR MORE

 

There are two relationships, one
between PRODUCT and ORDER, and the other between ORDER and CUSTOMER.

 

a.              
Each customer can place: min =0, max = many orders

b.              
Each order can be placed by: min one max one customers

c.               
Each order can list: min one max many products

d.              
Each product can be listed on: min zero max many orders

 

 

6.      Check
the Model:

 

The final step in creating an E-R
diagram is often overlooked, but is just as important as any of the previous
steps. Analysts who fail to carefully check their ERD often produce diagrams of
poor quality, which of course should be avoided.

In order to check the ERD, you must
return to your original information sources, the forms, reports, and interviews
with users. The basic idea is to go back to the original documents and make
sure that the structure represented in the ERD can satisfy the requirements.

 

x

Hi!
I'm Katy!

Would you like to get a custom essay? How about receiving a customized one?

Check it out