Open In App

Difference between Entity and Object

Last Updated : 29 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

A database is a organized collection of logical related data stored in a software named Database Management Systems (DBMS). Before inserting the data into the system, it needs to be in the form of a model for appropriate understanding of the database. Many models were introduced and Entity-Relationship model is one among them. It is a graphical representation of the data which gives the whole view of the data. There are basic building units of this E-R model where entity and object are among them. 1. Entity: An entity is a real time object that is different from others. An entity can defined using its attributes. They are a part of entity. Entities can be represented in pictorial form. Collection of similar entities is an entity set.

Example: 
A computer, car, place, software 

2. Object: An entity that contains both attributes and actions is its object. It is defined by its life span, name and object identifier. Every object has two components: State and Behavior.

Example: 
views, indices, sequences 

Differences between entity and object are: 

S.NO Entity Object
1. Entity is a real time object that can be distinguished from other objects. Object is an entity that has all the attributes and the actions required to be taken.
2. An entity contains of attributes. An object has life span, object identifier.
3. Entity is a uniquely identifiable object. An object can be identified using its identifier.
4. Every entity has a primary key for identification purposes. Object is not assigned with a primary key.
5. Entity is a part of relational database. Object is a part of object oriented database.
6. Entities are represented in rectangular shape using E-R diagram. Objects aren’t represented graphically.
7. Attributes is a property of entity. Inheritance, Encapsulation, Polymorphism and Abstraction are part of object.
8. Example: Computer, Software. Example: Minimum age to vote is 18.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads