🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

ER Diagram (ERD) - Definition & Overview.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart The components and features of an ER diagram ER Diagrams are composed of entities, relationships and attributes. They also depict cardinality, which defines relationships in te...

9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart The components and features of an ER diagram ER Diagrams are composed of entities, relationships and attributes. They also depict cardinality, which defines relationships in terms of numbers. Here’s a glossary: Entity A definable thing—such as a person, object, concept or event—that can have data stored about it. Think of entities as nouns. Examples: a customer, student, car or product. Typically shown as a rectangle. Entity type: A group of definable things, such as students or athletes, whereas the entity would be the specific student or athlete. Other examples: customers, cars or products. Entity set: Same as an entity type, but defined at a particular point in time, such as students enrolled in a class on the first day. Other examples: Customers who purchased last month, cars currently registered in Florida. A related term is instance, in which the specific person or car would be an instance of the entity set. Entity categories: Entities are categorized as strong, weak or associative. A strong entity can be defined solely by its own attributes, https://www.lucidchart.com/pages/er-diagrams 7/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart while a weak entity cannot. An associative entity associates entities (or elements) within an entity set. Entity keys: Refers to an attribute that uniquely defines an entity in an entity set. Entity keys can be super, candidate or primary. Super key: A set of attributes (one or more) that together define an entity in an entity set. Candidate key: A minimal super key, meaning it has the least possible number of attributes to still be a super key. An entity set may have more than one candidate key. Primary key: A candidate key chosen by the database designer to uniquely identify the entity set. Foreign key: Identifies the relationship between entities. Relationship How entities act upon each other or are associated with each other. Think of relationships as verbs. For example, the named student might register for a course. The two entities would be the student and the course, and the relationship depicted is the act of enrolling, connecting the two entities in that way. Relationships are typically shown as diamonds or labels directly on the connecting lines. https://www.lucidchart.com/pages/er-diagrams 8/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Recursive relationship: The same entity participates more than once in the relationship. Attribute A property or characteristic of an entity. Often shown as an oval or circle. Descriptive attribute: A property or characteristic of a relationship (versus of an entity.) Attribute categories: Attributes are categorized as simple, composite, derived, as well as single-value or multi-value. Simple: Means the attribute value is atomic and can’t be further divided, such as a phone number. Composite: Sub-attributes spring from an attribute. Derived: Attributed is calculated or otherwise derived from another attribute, such as age from a birthdate. https://www.lucidchart.com/pages/er-diagrams 9/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Multi-value: More than one attribute value is denoted, such as multiple phone numbers for a person. Single-value: Just one attribute value. The types can be combined, such as: simple single-value attributes or composite multi-value attributes. Cardinality Defines the numerical attributes of the relationship between two entities or entity sets. The three main cardinal relationships are one-to- one, one-to-many, and many-many. A one-to-one example would be one student associated with one mailing address. A one-to-many example (or many-to-one, depending on the relationship direction): One student registers for multiple courses, but all those courses have a single line back to that one student. Many-to-many example: Students as a group are associated with multiple faculty members, and faculty members in turn are associated with multiple students. https://www.lucidchart.com/pages/er-diagrams 10/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Cardinality views: Cardinality can be shown as look-across or same- side, depending on where the symbols are shown. Cardinality constraints: The minimum or maximum numbers that apply to a relationship. Mapping natural language ER components can be equated to parts of speech, as Peter Chen did. This shows how an ER Diagram compares to a grammar diagram: Common noun: Entity type. Example: student. Proper noun: Entity. Example: Sally Smith. Verb: Relationship type. Example: Enrolls. (Such as in a course, which would be another entity type.) Adjective: Attribute for entity. Example: sophomore. Adverb: Attribute for relationship. Example: digitally. The database query language ERROL actually mimics natural language constructs. ERROL is based on reshaped relational algebra (RRA) and works with ER models, capturing their linguistic aspects. https://www.lucidchart.com/pages/er-diagrams 11/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Want to make an ERD of your own? Try Lucidchart. It's quick, easy, and completely free. Make an ERD ERD symbols and notations There are several notation systems, which are similar but vary in a few specifics. Chen notation style https://www.lucidchart.com/pages/er-diagrams 12/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart https://www.lucidchart.com/pages/er-diagrams 13/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Crow’s Foot/Martin/Information Engineering style Bachman style https://www.lucidchart.com/pages/er-diagrams 14/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart IDEF1X style https://www.lucidchart.com/pages/er-diagrams 15/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Barker style https://www.lucidchart.com/pages/er-diagrams 16/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Examples Following are examples of ERD diagrams made in each system. https://www.lucidchart.com/pages/er-diagrams 17/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Conceptual, logical and physical data models ER models and data models are typically drawn at up to three levels of detail: https://www.lucidchart.com/pages/er-diagrams 18/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart Conceptual data model: The highest-level view containing the least detail. Its value is showing overall scope of the model and portraying the system architecture. For a system of smaller scope, it may not be necessary to draw. Instead, start with the logical model. Logical data model: Contains more detail than a conceptual model. More detailed operational and transactional entities are now defined. The logical model is independent of the technology in which it will be implemented. Physical data model: One or more physical model may be developed from each logical model. The physical models must show enough technology detail to produce and implement the actual database. Note that similar detail and scope levels exist in other types of diagrams, such as data flow diagrams, but that it contrasts with software engineering’s three schema approach, which divides the information a bit differently. Sometimes, engineers will branch out ER diagrams with additional hierarchies to add necessary information levels for database design. For example, they may add groupings by extend up with superclasses and down with subclasses. Limitations of ER diagrams and models Only for relational data: Understand that the purpose is to show relationships. ER diagrams show only that relational structure. Not for unstructured data: Unless the data is cleanly delineated into different fields, rows or columns, ER diagrams are probably of limited use. The same is true of semi-structured data, because only some of the data will be useful. Difficulty integrating with an existing database: Using ER Models to integrate with an existing database can be a challenge because of the different architectures. https://www.lucidchart.com/pages/er-diagrams 19/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart How to draw a basic ER diagram 1. Purpose and scope: Define the purpose and scope of what you’re analyzing or modeling. 2. Entities: Identify the entities that are involved. When you’re ready, start drawing them in rectangles (or your system’s choice of shape) and labeling them as nouns. 3. Relationships: Determine how the entities are all related. Draw lines between them to signify the relationships and label them. Some entities may not be related, and that’s fine. In different notation systems, the relationship could be labeled in a diamond, another rectangle or directly on top of the connecting line. 4. Attributes: Layer in more detail by adding key attributes of entities. Attributes are often shown as ovals. 5. Cardinality: Show whether the relationship is 1-1, 1-many or many-to- many. More tips for ER diagrams 1. Show the level of detail necessary for your purpose. You might want to draw a conceptual, logical or physical model, depending on the detail needed. (See above for descriptions of those levels.) 2. Watch for redundant entities or relationships. 3. If you’re troubleshooting a database problem, watch for holes in relationships or missing entities or attributes. 4. Make sure all your entities and relationships are labeled. https://www.lucidchart.com/pages/er-diagrams 20/22 9/10/24, 3:39 PM ER Diagram (ERD) - Definition & Overview | Lucidchart 5. You can translate relational tables and ER diagrams back and forth, if that helps you achieve your goal. 6. Make sure the ER diagram supports all the data you need to store. 7. There may be different valid approaches to an ER diagram. As long as it provides the necessary information for its scope and purpose, it’s good. Helpful Resources Enhanced ER Diagram Tutorial How to Draw an ER Diagram Entity-Relationship Diagram Symbols and Notation Lucidchart lets you easily create ER diagrams, with smooth placement of shapes, lines and labels. With all editing taking place in the cloud, it’s easy to collaborate with colleagues. You can share your diagram digitally or via print. Want to make an ERD of your own? Try Lucidchart. It's quick, easy, and completely free. Make an ERD https://www.lucidchart.com/pages/er-diagrams 21/22

Use Quizgecko on...
Browser
Browser