Professional Documents
Culture Documents
Outline
Main phases of DB design ER Model Basics Entities
Entity set,strong entity,weak entity
Attributes
Atomic,Multivalued,composite,derived attributes
Relationships
Degree of relationships Types of relationships /Cardinalities
Entity-Relationship(ER) Model
The ER model is a high-level conceptual data model. It is a powerful short hand often used in database design at requirement analysis phase. The ER model was introduced by Peter Chen in 1976, and is now the most widely used conceptual data model.
IS C 332,Database Systems & Applications , CSIS , BITSPilani,K.K.Birla Goa Campus 4
E-R Model
Views the real world as a set of basic objects (entities) and relationships among these objects. It is intended primarily for the DB design process by allowing the specification of an enterprise scheme. This represents the overall logical structure of the DB. ( Conceptual Design )
ER Model
ER-Model describes data as
ER Model
Entity: Real-world object distinguishable from other objects. It can be an object, a place or concept. An entity is described (in DB) using a set of attributes. E.g., student city course instructor Hostel
ER Model Basics
Entity Set: A collection of similar entities. E.g., all students, all courses. . All entities in an entity set have the same set of attributes (Until we consider ISA hierarchies (EER)) . Each entity set has a key. . Each attribute has a domain.
student
course
instructor
department
passeneg er
train
station
Travel
Strong Entity Type (parent, owner, dominant) An entity is strong if its existence is not dependent on some other entity type. Weak Entity Type (child, dependent, subordinate) An entity is weak if its existence is dependent on some other entity type.
Attributes
Attribute is the particular properties that describe entity. The attribute values that describe each entity become a major part of the data stored in the database. For example Employee entity may describe by Name, Age, address, salary and job.
student
course
course_code course_name units l-t-p
instructor
department
dept_code dept_name location tel_no
15
passeneg er
ps_id ps_name gender address
train
train_id train_name source_id dest_id
station
travel
ps_id train_id s_id d_id
station_id station_nam e
ID 2007PSA4554 2007PSB4223
Attribute Value
Attributes
Simple/Atomic Composite Single-valued Multi-valued Stored Derived
Atomic Attribute
Atomic Attribute is an attribute that is not divisible. Called Atomic or Simple Attributes. Example
Student
Atomic/Simple
First Name
Last Name
Age
Composite Attributes
Composite Attributes can be divided into smaller subparts, which represent more basic attributes with independent meanings.
Composite Attribute
Address
Example
Attribute Age
A : 24 Years B : 27 Years
Degree
A : B.Tech B : B.Tech, M.Tech., PhD.
Attribute Value
IS C 332,Database Systems & Applications , CSIS , BITSPilani,K.K.Birla Goa Campus
Example
Attribute Age
A : 22 Years B : 48 Years
Birth Day
A : 13 July 1990 B : 23 Dec 1964
Stored Attribute
Attribute Value
Derived Attribute
Key Attribute
An attribute that whose values are distinct for each individual entity in the entity set.
Null Value
Some case a particular entity may not have an applicable value for an attribute. Example Degree attribute applied only to a person with collage degree. For this situations, a special value called null is create.
IS C 332,Database Systems & Applications , CSIS , BITSPilani,K.K.Birla Goa Campus
Relationships
Relationship: Association among two or more entities. E.g., Hassy registers courses course is allocated to Hassy Relationship Set: Collection of similar relationships. Same entity set could participate in different relationship sets, or in different roles in same set.
Dergree of Relationships
Unary, Binary, Ternary Unary: A relationship between the instances of a single entity set. Binary: A relationship between the instances of two entity sets Ternary: A simultaneous relationship between the instances of three entity sets.
IS C 332,Database Systems & Applications , CSIS , BITSPilani,K.K.Birla Goa Campus
Types of Relationships
Types of binary relationship from entity set A to entity set B one one :<-->: an entity in A is related to at most one entity in B and vice versa many one :-->: an entity in A is related to at most one entity in B many many :--: an entity in A is related to 0 or more entities in B and vice versa
Entity symbols
Attribute symbols
Relationship symbols