Database Management System Notes

Database Management System Notes

Entity Relationship Diagram (ERD)

  • Definition: An ERD illustrates the logical structure of a database by showing the relationships among entity sets.

  • Entity: An object or component of data in the database.

  • Entity Set: A collection of similar entities.

  • Attributes: Properties that define the characteristics of an entity.

ERD Symbols and Meanings

  • Rectangle: Represents an Entity Set (Strong)

  • Double Rectangle: Represents an Entity Set (Weak)

  • Ellipse: Represents an Attribute

  • Double Ellipse: Represents Multi-valued Attributes

  • Dashed Ellipse: Represents Derived Attributes

  • Ellipse with a line inside: Represents Key Attribute

  • Ellipse with other ellipses: Represents Composite Attributes

  • Diamond: Represents a Relationship Set

  • Double Diamond: Represents an Identifying Relationship

  • Double Lines: Represents Total Participation

  • Single Line: Represents Partial Participation

  • Triangle: Represents Specialization/Generalization

Cardinality in ERD

  • Example 1: Customer and Item

    • Relationship: Many to Many

    • Explanation: A customer can buy many items, and the same item can be bought by multiple customers.

  • Example 2: Customer, Loan, and Payment

Advantages of the E-R Model

  1. Simple Representation: E-R diagrams provide a straightforward way to represent relations in a database.

  2. Easy Mapping: Easily convertible to a relational model with tables and fields.

  3. Effective Communication Tool: Simple to understand, facilitating discussions between designers and end-users.

  4. Design Tool: Useful for planning database designs in specific management software.

  5. Conversion Flexibility: Can be updated or converted to network or hierarchical models with ease.

  6. Graphical Overview: Offers a visual diagram of entities, attributes, and their relationships.

  7. Ease of Modification: Changing an E-R diagram is simpler compared to other modeling methods.

Limitations of the E-R Model

  • Cannot express relationships between other relationship sets.

Types of Entity Sets

  1. Strong Entity Sets:

    • Definition: Entity sets with key attributes.

    • Example: A Student entity set with a key attribute Reg_No.

  2. Weak Entity Sets:

    • Definition: Entity sets without key attributes.

    • Example: A Table entity set with no distinguishing key attributes.

Guided Exercises

  • Create an ERD for the following entities:

    1. College

    • Attributes: college_id, name, description

    1. Course

    • Attributes: courseid, coursecode, description

    1. Section

    • Attributes: sectionid, sectioncode, year_level, semester, campus

References

  • Coronel, C., & Morris, S. (2015). Database Systems: Design, Implementation, and Management. Cengage Learning.

  • Heijden, H. (2009). Designing Management Information Systems. Oxford University Press.

  • Gupta, S., & Mittal, A. (2017). Introduction to Database Management System. University Science Press.