Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Database / Difference Between Entity and Attribute

Difference Between Entity and Attribute

June 11, 2011 Posted by Indika

Entity vs Attribute

Entity-relationship modeling (ERM) technique is widely used for modeling databases. Entity-relationship modeling is the process of coming up with an abstract and conceptual representation of data. One of the main building blocks of ERM is an entity. Entity represents a real world object or a thing that can stand on its own independently and can be identified uniquely. Attributes are the properties of these entities. ER diagrams are the product of entity-relationship modeling. ER diagrams are drawn using entities, attributes and other symbols (such as relationships).

What is an Entity?

An entity represents a thing that can exist independently and that can be identified uniquely. More specifically, an entity often represents a class, group or category of similar objects. Most often, an entity represents a real world object such as a car or an employee. Entities can be though of as nouns that come up during the description of the problem to be solved. Entities are represented as tables in relational databases. In general, each entity will map to exactly one table in the database. Individual rows in the tables correspond to the actual instances of the object/thing represented by the entity. For example, in an Employee database, each row corresponds to records of individual employees of the company.

What is an Attribute?

In the entity-relationship modeling, properties of entities are called attributes. In other words, attributes represent a sub group of information of the object represented by the entity. Attributes define the individual instances and help to differentiate between each instance by describing their characteristic. It is important to note that attributes cannot be set-valued and they should be atomic. In relational databases, where entities are realized as tables, each column represents the attributes of these entities. For example, in the Employee table, columns such as department, rank and salary are examples of attributes of the employees. In order to differentiate between individual instances of the entity, one or more attribute fields with unique values (for all instances) can be selected as a key. For example, the social security number attribute (which is unique for all employees) is often used as the primary key of an Employee table. Sometimes multiple attributes can makeup the primary key as well.

What is the difference between an Entity and an Attribute?

In entity-relationship modeling, entities represent real world objects/things that can be identified as unique and independent, while attributes represent the properties of those entities. In relational databases, entities become tables (each row representing individual instances), whereas attributes become columns of those corresponding tables. When designing databases, it is common to have confusion over choosing an entity vs. an attribute to represent a certain real word object. For example, should the address of the employee represented as an attribute or another entity (connected to employee entity through a relationship)? A general rule of thumb is, if an employee has more than one address, then the address must be an entity (because attributes are not set-valued). Similarly, if the structure of the address is important to capture, then again the address should be an entity (because attributes are atomic).

Related posts:

Difference Between SQL Server 2008 and Express Difference Between RDBMS and ORDBMS Difference Between DBMS and Data Warehouse Difference Between Stack and Heap Difference Between ER Diagram and Class Diagram

Filed Under: Database Tagged With: attribute, Entity, Entity-relationship modeling, ER diagrams, ERM, ERM technique

About the Author: Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Bottled Water and Tap Water

Difference Between Bottled Water and Tap Water

Difference Between Currency Swap and FX Swap

Difference Between Acropetal and Basipetal Order

Difference Between Acropetal and Basipetal Order

What is the Difference Between Tungsten Carbide and Boron Carbide

What is the Difference Between Tungsten Carbide and Boron Carbide

Difference Between Static Energy and Kinetic Energy

Latest Posts

  • What is the Difference Between Pancytopenia and Thrombocytopenia
  • What is the Difference Between Sandwich Elisa and Competitive Elisa
  • What is the Difference Between Mayor and Governor
  • What is the Difference Between ABI and TBI
  • What is the Difference Between Primary and Secondary Addison’s Disease
  • What is the Difference Between Pityriasis Alba and Tinea Versicolor
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018 Difference Between. All rights reserved. Terms of Use and Privacy Policy: Legal.