0% found this document useful (0 votes)
3 views

chap 2 dbms

Uploaded by

pavan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

chap 2 dbms

Uploaded by

pavan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 2

Data Modeling Using the Entity-Relationship Model


The Steps For Data Base Design Are:
1. Requirement collection and analysis: The data base designer interview, the data base user to
understand and document their requirements. There are 2 types of requirements.
a) DataBase requirement-requirement should be specified as detail as possible and complete a
form.
b) Functional requirement-It consists of user defined operations to design application program.

2. Conceptual design:-
After requirement have been collected and analyzed, the database creates a conceptual schema
using a high level data model called conceptual design. The conceptual schema includes brief
description of data requirements and detailed description of entity types, relationships and
constraints.

3. Logical design:-
The actual implementation of a data base, using a commercial DBMS .The conceptual schema is
transformed form high level data model into the implementation data model called logical design
or data model mapping.

4. Physical design:-
It defines the internal storage structure, index, and accesses path and file organization in the
database.

In parallel application programs are designed and implemented as data base transactions to the
high level transcation specifications.

Entity: An entity is an object in the real world with an independent existence.


Ex: employee, department, project etc
Attribute: An attribute which describe the particular properties of the entity.
Ex: fname, age, address, salary, pnumber etc

The different types of attributes are:


1. Simple (atomic) versus composite attributes
2. Single-valued versus multi valued attributes
3. Stored versus derived attributes
4. NULL values
5. Complex attributes.
1. Simple attribute − Simple attributes are atomic values, which cannot be divided further.
Ex: ssn, regno
Composite attribute − Composite attributes can be divided into smaller subparts,which
represent basic attribute with independent meaning.
Ex: a student's name may have first_name and last_name , address is divided into streetname,
doorno ,city, state, zip etc.
2. Single-value attribute – Attributes that contain single value.
Ex: − ssn, age
Multi-valued attribute − Attributes may contain more than one values.
Ex: a person can have more than one phone number, email_address, etc.
3. Derived attribute − Attributes that are derived from other attributes present in the database.
Stored attribute - Attribute from which other attribute can be derived
Ex: Age can be derived from DOB .Age is derived attribute and DOB is called stored attribute
4. NULL Values – Entities that may not have an applicable values for an attribute.
Ex: Fax_number,
5. Complex Attributes - It is formed by nesting composite attributes and multi-valued attributes
in arbitrary way. Here {} are used to enclose multivalued attributes and () are used to enclose
composite attributes with comma separating individual attributes.
Ex: { Addressphone (phone {(Area Code, Phone Number)}, Address(Sector Address (Sector
Number,House Number), City, State, Pin))}

Entity type & Entity set


Entity type: Collection (or set) of entities that have the same attributes. Each entity type in the
database is described by its name & attribute.
Entity set: The collection of all entities of a particular entity type in the database at any point in
time.

Key constraint: Attributes whose values are distinct for each individual entity in entity set
Value sets (or domain of values) :Specifies set of values that may be assigned to that attribute
for each individual entity
Relationship : When an attribute of one entity type refers to another entity type

Relationship type(R): Relationship type(R) among n entity types E1, E2, ..., En defines a set of
associations among entities from these entity types

A relationship set is a set of relationships of the same type.


Relationship instances (ri): Each ri associates n individual entities (e1,e2, ..., en). Each entity ej
in ri is a member of entity set Ej

Degree of a relationship type : Degree of a relationship type is the number of participating


entity types.
a)Binary relationship: A Binary relationship is the one that links two entities sets.
b)Ternary Relationship: A Ternary relationship is the one that involves three entities.

Role names : Role name signifies role that a participating entity plays in each relationship
instance and helps to explain what does the relationship means?

Recursive relationships :Same entity type participates more than once


in a relationship type in different roles. Must specify role name
Relationship Attributes: Relationship types can have attributes as well. in case of 1:1 or 1:N
relationships, attributes can be migrated to one of the participating entity types.
Weak Entity Type:
 Entity Types that do not have key attributes.
 Such entities are identified by being related to other entity sets called identifying owner.
 This relationship is called identifying relationship

Partial key :Attributes that uniquely identify entities within the identifying relationship. A weak
entity type always has TOTAL participation

Participation constraint: Specifies whether existence of an entity depends on its being related
to another entity. There are 2 types: total and partial

Cardinality ratio for a binary relationship: Specifies maximum number of relationship


instances that entity can participate in.

Mapping Cardinalities: Express the number of entities to which another entity can be
associated via a relationship. For binary relationship sets between entity sets A and B, the
mapping cardinality must be one of:

1. One-to-one: An entity in A is associated with at most one entity in B, and an entity in B


is associated with at most one entity in A.

2. One-to-many: An entity in A is associated with any number in B. An entity in B is


associated with at most one entity in A.

3. Many-to-one: An entity in A is associated with at most one entity in B. An entity in B is


associated with any number in A.
4. Many-to-many: Entities in A and B are associated with any number from each other.

Participation Constraints

The participation constraints specifies whether the existence of an entity depends on its
being related to another entity via a relationship type

There are two types of participation constraints— total and partial

1. Total participation, meaning that every entity in the total set of employee
entities must be related to a department entity via WORKS_FOR. Total participation
is also called existence dependency.

2. Partial participation, meaning that some or part of the set of employee entities are
related to some department entity via MANAGES, but not necessarily all.
Notation for ER diagram
ER diagram for COMPANY database
ER diagram for Hospital Management

You might also like