Unit 1 PART B
Unit 1 PART B
• A database thus includes a collection of entity sets, each of which contains any number
of entities of the same type.
• Figure shows part of a bank database that consists of two entity sets: customer and loan
• An attribute of an entity set is a function that maps from the entity set into a domain.
• An entity set may have several attributes,
• Each entity can be described by a set of (attribute, data value) pairs, one pair for each
attribute of the entity set.
• For example, a particular customer entity may be described by the set
{(customer-id, 677- 89-9011), (customer-name, Hayes), (customer-street, Main)}
• Composite Attributes:
• having several components in the value.
• divided attributes into subparts (other attributes).
• a composite attribute may appear as a hierarchy (Address)
Example:
• Qualification with components- (DegreeName, Year,
UniversityName)
• Land_line_no: (stdcode,areano,actualno)
• Address:
Department of Information Technology, Sanjivani COE
Kopargaon
Types of Attributes (2/3)
• Derived Attributes: Attribute value is dependent on some other
attribute.
Example:
• Age depends on DateofBirth: So age is a derived attribute.
• Interest amount: Based on Loan Amount
• Null Value:
• An attribute takes a null value when an entity does not have a value for
it.
• Example: Middle Name
• Null can also designate that an attribute value is unknown.
• An unknown value may be either missing (the value does exist, but we do not
have that information)
• not known (we do not know whether or not the value actually exists).
Department of Information Technology, Sanjivani COE
Kopargaon
Types of Attributes (3/3)
• Single-valued:
• having only one value rather than a set of values.
• for instance,
• PlaceOfBirth – single string value.
• Multi-valued:
• having a set of values rather than a single value.
• for instance:
• CoursesEnrolled attribute for student (all courses in semester)
• EmailAddress attribute for student (personal email, official email)
• PreviousDegree attribute for student.
• We define the
• relationship set borrower to denote the association between customers and the bank loans that the
customers have
• loan-branch to denote the association between a bank loan and the branch in which that loan is
maintained.
• The association between entity sets is referred to as participation; that is, the entity sets
E1, E2,...,En participate in relationship set R.
• A relationship instance in an E-R schema represents an association between the named
entities in the real-world enterprise that is being modeled
• Example:
• The individual customer entity Hayes, who has customer identifier 677-89-9011, and the loan entity
L-15 participate in a relationship instance of borrower.
• A relationship may also have attributes called descriptive attributes
• Entity sets student and course which participate in a relationship set registered-for