ER Diagram and Normal Forms
1. Answer the questions:
a) What is Generalization, Specialization and Aggregation?
Generalization:
It’s a bottom-to-top approach, where all the different attributes will get connected to the
particular entity. The entity that is created will contain the common features. Entities are
combined to form a more generalized entity, in other words, sub-classes are combined to form
a super-class.
Specialization:
Specialization is the opposite of Generalization. It’s a top-to-bottom approach where higher
entities can be broken down into two lower entities. Here the superclass is typically defined
first followed by the subclass and finally the relationship set.
Aggregation:
The term "aggregation" refers to the relationship between a whole entity and its constituents.
We can express relationships among relationships by using aggregation. The specific entities are
combined because they do not make sense on their own. To establish a single entity,
aggregation creates a relationship that combines these entities.
b) What is the many-to-many relationship? Give example.
When more than one record in one table is associated with more than one record in another
table, this is known as a many-to-many relationship. It is a kind of cardinality that describes the
relationship between two entities. Usually, the many-to-many relationship reflects the actual
relationship between the objects the two tables represent.
Example:
A typical example of a many-to-many relationship is a database used by universities in
registering for classes. Imagine two tables containing “Student table- which has a record for
each student” and “Classes- which has a record of each class”. In real life, A student can
register for many classes, and a class can include many students.
2. A physician office wants to send reminders (using emails) to their patients. To do this they
would like to use a database to keep track of which reminders are sent to which patients. A
reminder has a reminder ID (RID), a subject (Subject), and a body (Body). A patient is
identified by email address (Email) and patients’ data includes name and address. When a
reminder is sent, the date (SendDate) is recorded.
1. Answer the questions:
a) What is Generalization, Specialization and Aggregation?
Generalization:
It’s a bottom-to-top approach, where all the different attributes will get connected to the
particular entity. The entity that is created will contain the common features. Entities are
combined to form a more generalized entity, in other words, sub-classes are combined to form
a super-class.
Specialization:
Specialization is the opposite of Generalization. It’s a top-to-bottom approach where higher
entities can be broken down into two lower entities. Here the superclass is typically defined
first followed by the subclass and finally the relationship set.
Aggregation:
The term "aggregation" refers to the relationship between a whole entity and its constituents.
We can express relationships among relationships by using aggregation. The specific entities are
combined because they do not make sense on their own. To establish a single entity,
aggregation creates a relationship that combines these entities.
b) What is the many-to-many relationship? Give example.
When more than one record in one table is associated with more than one record in another
table, this is known as a many-to-many relationship. It is a kind of cardinality that describes the
relationship between two entities. Usually, the many-to-many relationship reflects the actual
relationship between the objects the two tables represent.
Example:
A typical example of a many-to-many relationship is a database used by universities in
registering for classes. Imagine two tables containing “Student table- which has a record for
each student” and “Classes- which has a record of each class”. In real life, A student can
register for many classes, and a class can include many students.
2. A physician office wants to send reminders (using emails) to their patients. To do this they
would like to use a database to keep track of which reminders are sent to which patients. A
reminder has a reminder ID (RID), a subject (Subject), and a body (Body). A patient is
identified by email address (Email) and patients’ data includes name and address. When a
reminder is sent, the date (SendDate) is recorded.