Entity and Attribute
Entity
An entity is a collection of distinguishable real world objects with common properties such as
student
and
course
.
student
An entity refers to the entity set (a table) and not to a single entity occurrence (a row).
An entity is represented by a rectangle ▭ containing the entity’s name.
Attribute
An attribute is a data item that describes a property of an entity or a relationship like
fname
and
cno
.
Attributes have a
domain
. The domain is the attribute’s set of possible values.
Each entity has an
identifier
(a set of attributes or candidate keys). Each entity has a
primary identifier
(primary key).
Descriptor
is an attribute, but not identifier.
Composite attribute
is an attribute that can be further subdivided to yield additional attributes.
Simple attribute
is an attribute cannot be subdivided.
Single-valued attribute
can have only a single value.
Multi-valued attribute
can have many values (double lines).
Attributes are represented by ovals ⬭ that are connected to the entity by a line. Each oval contains the name of the attribute it represents.
An example of entities and attributes are given as follows: