130 likes | 249 Views
Entity-relationship diag rams a nd generation. Jozef Kuper. ERD. Describe a Database Entities Atributes Relationships. ERD – Entity and atributes. Physical object, concept or event Entity represent table Attributes represent collums Primary key. ERD - Relationships.
E N D
Entity-relationship diagramsand generation Jozef Kuper
ERD • Describe a Database • Entities • Atributes • Relationships
ERD – Entity and atributes • Physical object, concept or event • Entity represent table • Attributes represent collums • Primary key
ERD - Relationships • Represented as a lines between entities • May be labeled • Don’t show single instance of relations • Entity sets • Relationships sets • Optional relationship • Mandatory relationship
Cardinality • One-to-one • One-to-many • Many-to-many
Levels of ER model • Conceptual data model • Useful to support documenting the data architecture • Logical data model • Physical model
One-to-one • Unusual • Used in large tables • Safety
Many-to-one • Most used • Relationship 1:N | N:1 • Primary key / Foreign key • Classifications
Many-to-many • Can not be implemented • Generated associated entity • Combination of entity and relationship
Recursive relation • Some entity participates more than once in the relationship • Some common attributes • <Employee>reports to<Employee>(manager)
How to create ERD • Identify the entity • Identify the entity’s attribute • Identify Primary Keys • Identify relations between entities • Identify the Cardinality constraint
Thanks for your attention Questions?