Entity and Entity Sets are primary elements of ER Modeling. According to definition an entity is a thing or an object in the real world. But a very important feature for an object to be an entity is that it should be distinguishable from other objects. The distinction is based on the values of the attributes it possess. In other words, there must be some possibility to distinguish an object from other objects. Identification of entities is important because we have to make a database of multiple objects. If we are not able to distinguish/ identify an object then we cannot retrieve it.
Entity and Entity Sets – on the Basis of Existence
Entities are of two types- tangible and intangible.
Entities exist physically in real world. All objects with reference to your area of system study that you can touch and feel are tangible entities. For example a client, car, bus, item, house, organization, employee, student etc.
Entities which exists logically or certain events can be categorised as Intangible entities. Admission, bank account, order, sale, purchase, concert can be considered as intangible entities. A bank account does not exist physically but yes it has a number, account holder’s name, opening account, balance etc. So, this is an intangible entity.
An entity set is a collection of same type of entities i.e. they share same properties or attributes.
Let us take an example of a student. A student has a unique roll no, name, date of birth etc. So an entity set will be set of all those people in a college or school who are students.
|Roll No.||Name||Date of Birth|
Here Student is an entity type and students with roll no 101,102,103,104 are different entities of type student. Collectively the students’ records are an entity set.
In a database we usually store similar information about objects. Like in a college database suppose we want to store information about students. Then it is sensible that we maintain same information about all the students like their name, roll numbers, registration number, contact number, address, date of birth etc. These student entities share the same attributes but each entity has its different value for each attribute.
In the following example Student is an Entity and Entity Sets is set of all students. So you can say entity type is a collection of entities that have same attributes with different values. Also a specific occurrence of entity type is called the entity’s instance.
ENTITY TYPE NAME :- STUDENT
(Roll no., Name, DOB, Contact No.)
|S1 (101, Keith,12.12.1992, 9999888074)|
S2(102, Adrian, 14.06.1993, 8875623900)
S3 (103, Anne, 04.09.1993, 7890327190)
S4 (104, Mathew, 07.08.1991, 7658734560)
Key Attributes of an Entity Type
An entity type usually has an attribute whose values are distinct for each entity in the entity set. Such attribute is called a Key attribute. The value of key attribute can be used to identify each entity uniquely. For example, Roll Number is the key attribute of the Student entity type because each student will have a different Roll Number. We can easily identify each student with the help of her Roll Number.