What is the ER model? Explain entity, entity set, attribute and relationship.
EasyConceptER Model
Answer
The entity-relationship (ER) model is a high-level design model that describes data as entities, their attributes and the relationships among them. It is drawn as an ER diagram and later converted into tables.
- Entity: a real-world object that can be told apart from others, such as the student Asha. An entity set (or entity type) is the collection of similar entities, such as all students, and it becomes a table.
- Attribute: a property of an entity, such as
rollorname, which becomes a column. A key attribute, drawn underlined, identifies each entity. - Relationship: an association between entities, such as a student enrols in a course. A relationship can have its own attributes, such as
grade.
Example:
[Student] ----- <Enrols> ----- [Course]
roll, name grade course_id, title
Converted to tables: student(roll, name), course(course_id, title) and enrols(roll, course_id, grade), where enrols holds foreign keys to both entity tables.