Entity Relationship Diagram Definition

Entity Relationship Diagram Definition

Entity-Relationship Diagram Definition GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Software & Apps > Apps 36 36 people found this article helpful

Entity-Relationship Diagram Definition

Use ER diagrams to illustrate relationships between database entities

By Mike Chapple Mike Chapple Writer University of Idaho Auburn University Notre Dame Former Lifewire writer Mike Chapple is an IT professional with more than 10 years' experience cybersecurity and extensive knowledge of SQL and database management. lifewire's editorial guidelines Updated on June 10, 2021 Tweet Share Email Tweet Share Email

In This Article

Expand Jump to a Section What Are Entity-Relationship Diagrams Entity-Relationship Diagram Example Entities Are Objects That Are Tracked Attributes Describe Entities Relationships Hold the Data Together Create an ER Diagram An entity-relationship diagram is a specialized graphic that illustrates the relationships between entities in a database. ER diagrams use symbols to represent three types of information: entities (or concepts), relationships, and attributes.

What Are Entity-Relationship Diagrams

In industry-standard ER diagrams, rectangles or squares represent entities, which are tables that hold specific information in a database. Diamonds represent relationships, which are the interactions between the entities. Ovals represent attributes, or data that describes an entity. Although entity-relationship diagrams may look complicated, these diagrams help knowledgeable users understand database structures at a high level without accompanying details. Database designers use ER diagrams to model the relationships between database entities in a clear format. Many software packages have automated methods to generate ER diagrams from existing databases.

Entity-Relationship Diagram Example

Consider the example of a database that contains information about the residents of a city. The ER diagram shown in the image below contains two entities in rectangles: "Person" and "City." A single "Lives In" relationship in the diamond ties the two together. Each person lives in only one city, but each city can house many people. In the example diagram, attributes shown in ovals are the person's name and the city's population. Nouns are used to describe entities and attributes while verbs are used to describe relationships.

Entities Are Objects That Are Tracked

Each item that is tracked in a database is an entity, and each entity is a table in a relational database. Usually, each entity in a database corresponds to a row. If a database contains the names of people, its entity might be called "Person." A table with the same name would exist in the database, and every person would be assigned to a row in the "Person" table.

Attributes Describe Entities

Databases contain information about each entity. This information is referred to as attributes. Attributes consist of information unique for each entity listed. In the "Person" example, attributes could include first name, last name, birth date, and an identifying number. Attributes provide detailed information about an entity. In a relational database, attributes are held in the fields where the information inside a record is held. A database is not limited to a specific number of attributes.

Relationships Hold the Data Together

The value of an entity-relationship diagram lies in its ability to display information about the relationships between entities. In the example, information about the city where each person lives can be tracked. Information about the city in a "City" entity with a relationship that ties together "Person" and "City" information can also be tracked. There are three types of relationships between entities: One-to-One: Sometimes a single entity is associated with a single other entity. For example, each employee in a database has only one Social Security number, and the number is unique.One-to-Many: A single entity may also be related to several other entities. For example, a company branch office and all the employees who work at that branch have a one-to-many relationship.Many-to-Many: Multiple entities may be related to multiple other entities. For example, a company may manufacture three products, and have a sales staff that sells those products. Some of the sales staff may split their time between the products.

How to Create an ER Diagram

Before you design a relational database, it makes sense to create an ER diagram. You may have software that is equipped to handle this process. If not, Put pen (or pencil) to paper, or find a software program that can handle the charting requirements. To create an ER diagram by hand: Create a rectangular box for each entity or concept relevant to your model. Draw lines to connect related entities to model the relationships. Label the relationships using verbs inside diamond shapes. Identify the relevant attributes for each entity, beginning with the most important attributes, and enter them in ovals in the diagram. Later, you can make the attribute lists more detailed. When you finish, you have illustrated how different concepts relate to one another, and you have a conceptual foundation for the design of a relational database. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Subscribe Tell us why! Other Not enough details Hard to understand Submit More from Lifewire Full Functional Dependency in Database Normalization An Introduction to Databases for Beginners A Guide to Understanding Database Dependencies Use the Invisible Web to Find People What Is a File System and What Are the Different Kinds? What Is the Primary Key in a Database? How to Make a Timeline on Google Slides Use Access Input Forms to Enter and Modify Data Glossary of Common Database Terms Introduction to Database Relationships What is MySQL? Spreadsheets vs. Databases What Is a Database Schema? The Basics of Database Normalization What Is Data Mining? A Database Attribute Defines the Properties of a Table Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Cookies Settings Accept All Cookies
Share:
0 comments

Comments (0)

Leave a Comment

Minimum 10 characters required

* All fields are required. Comments are moderated before appearing.

No comments yet. Be the first to comment!