Entity-Relational Model (E-R Model) :
Database design representation will be done using E-R Model.
An entity is a any object, place, person, concept o activity about which an enterprise records data.
An attribute is the characteristic property of an existing entity. Attribute type is the property of entity type, and attribute instance is the property of entity instance.
An ellipse always represents the attribute.
Relationship among data:
A relationship is defined as "an association among entities". A relationship type is an association of entity types. While a relationship instance is an association of entity instances.
A relationship may associate an entity with itself. Several relationships may exist between the same entities.
The three different types of relationships recognized among various data stored in the database are:
- One - to - one
- One - to - Many (or Many - to - one )
- Many - to - Many
Consider for example a set of students in a class. Each student can have only one Roll number. Similaryly each role number can be associated with on Student. This is the case of a one-to-one relationship.
One student can register for only one particular course at a time, whereas a number of students could register for the same course.
A vendor can sell a number of items and many vendors can sell a particular item.