Professional Documents
Culture Documents
Amacc Las Piñas City - Week 4
Amacc Las Piñas City - Week 4
WEEK 4 : Discuss and illustrate ER-model, entities, Relationship and attribute; Basic concepts, mapping
Constraints, Keys
ER-MODEL
DERIVED MANY TO
MANY
You can create a well-designed database by using ER Modeling to methodically assess your data
requirements. Therefore, finishing ER modeling before installing your database is regarded as best
practice.
ENTITY
What is Entity? a tangible, plainly recognized, and unrecognizable living or nonliving entity. Anything
within the company must be represented in our database. It could be a tangible object, a simple fact
about the company, or an actual event that takes place.
An entity, which contains data in the database, might be a place, person, item, event, or concept. Entities
Notation of an Entity
Entity set:
Student
A collection of entities of the same kind is known as an entity set. It might include entities whose
attributes have values that are similar. Properties, usually referred to as attributes, are used to represent
entities. Each characteristic has a unique value. A student entity, for instance, might have a name, age,
and class as properties.
Student Class
Example of Entities:
There could be some departments at a university. These departments all provide a variety of curricula
and employ a variety of professors.
Each program is composed of a few courses. Students sign up for a certain program and sign up for
various courses inside it. Each course is taught by a lecturer from the designated department, who
teaches a different group of students.
Weak Entities
An entity that lacks its primary attribute is referred to as weak. By taking into account the main key of
another entity, it can be uniquely identified. Weak entity sets must be involved in order for that to
happen.
TYPE
ATM ID
ADDRESS AMOUNT
TIME
TRANS NO
Weak
ATM TRANSACTION
Relation
"Trans No" is a discriminator inside a group of transactions in an ATM in the ER Diagram examples above.
ATTRIBUTE
A lecture, for instance, might have the following attributes: time, date, duration, location, etc.
Relationship is nothing but an association among two or more entities. E.g., Tom works in the
Chemistry department.
TRANS NO
AMOUNT
TYPE
TOM CHEMISTRY
TRANSACTION
Entities take part in relationships. We can often identify relationships with verbs or verb phrases.
For example:
Cardinality
Defines the numerical attributes of the relationship between two entities or entity sets.
One-to-one Relationships
One-to-many Relationships
Many-to-one Relationships
Many-to-many Relationships
Relationship Cardinality
Mandatory one
Mandatory many
Optional one
Optional many
1.One-to-one:
One entity from entity set X can be associated with at most one entity of entity set Y and vice versa.
Example: One student can register for numerous courses. However, all those courses have a single
line back to that one student.
Student Course
2.One-to-many:
One entity from entity set X can be associated with multiple entities of entity set Y, but an entity
from entity set Y can be associated with at least one entity.
Class Student
3. Many to One
More than one entity from entity set X can be associated with at most one entity of entity set Y.
However, an entity from entity set Y may or may not be associated with more than one entity
from entity set X.
Student Class
4. Many to Many:
One entity from X can be associated with more than one entity from Y and vice versa.
For example, Students as a group are associated with multiple faculty members, and faculty
members can be associated with multiple students.