Difference between Entity and Object

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.

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.

views, indices, sequences 

Differences between entity and object are:

S.NO Entity Object
1. Entity is a real time object that can be distinguised 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.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.