DBMS Assignment2
DBMS Assignment2
Generalization is a bottom-up approach in which two lower level entities combine to form a
higher level entity. In generalization, the higher level entity can also combine with other lower
1
Department of Computer Science & Information Technology
• Declare primary key of higher-level table and the primary key for lower-level table.
2
Department of Computer Science & Information Technology
3
Department of Computer Science & Information Technology
4
Department of Computer Science & Information Technology
5
Department of Computer Science & Information Technology
Theory Questions:-
Q.1 Explain the need of EER diagrams
Ans- EER (Enhanced Entity-Relationship) diagrams are an extension of the traditional Entity-
Relationship (ER) diagrams used in database design. They are particularly useful in modeling
complex database structures and relationships. Here are some reasons why EER diagrams are
needed:
1. Enhanced Modeling Capabilities: EER diagrams provide additional modeling constructs beyond
those offered by basic ER diagrams. These enhancements include concepts like subclasses,
superclasses, specialization, and generalization. This allows for more accurate and comprehensive
representation of real-world scenarios in the database design.
2. Inheritance and Generalization: EER diagrams support the concepts of inheritance and
generalization, allowing entities to be organized into hierarchies. This is especially beneficial
when dealing with entities that share common attributes but also have unique characteristics. For
example, a "Person" entity can be a superclass with subclasses like "Student" and "Employee."
3. Subtypes and Supertypes: EER diagrams allow the modeling of subtypes and supertypes,
enabling the representation of different categories of entities within a single entity set. This is
helpful when there are entities that share some common attributes but also have additional
attributes specific to their subtype.
4. Attribute Inheritance: In EER diagrams, attributes can be inherited from superclasses to
subclasses, reducing redundancy and promoting a more modular and maintainable database
design.
5. Relationship Types: EER diagrams support more advanced relationship types, such as
identifying relationships and participation constraints. Identifying relationships are used to
represent relationships where the child entity's primary key includes the primary key of the
parent entity. Participation constraints specify whether an entity is required or optional in a
relationship.
6. Complex Relationships: EER diagrams allow for the representation of complex relationships,
including recursive relationships where an entity is related to itself. This capability is essential
when modeling intricate connections within a database.
7. Enhanced Constraints: EER diagrams support additional constraints, such as the disjoint and
overlapping constraints for representing whether subtypes are mutually exclusive or can overlap.
8. Visual Clarity: The enhanced notation and symbols used in EER diagrams provide a clearer and
more expressive way to communicate complex database designs, making it easier for
stakeholders to understand the relationships and constraints involved.
6
Department of Computer Science & Information Technology
Q.2 Explain in detail Generalization, specialization and Aggregation and how do we convert
them into relational model.
Ans - Generalization is the process of extracting common properties from a set of entities and
creating a generalized entity from it. It is a bottom-up approach in which two or more entities
can be generalized to a higher-level entity if they have some attributes in common.
In generalization, the higher level entity can also combine with other lower level entities to make
further higher level entity.
It's more like Superclass and Subclass system, but the only difference is the approach, which is
bottom-up. Hence, entities are combined to form a more generalised entity, in other words, sub-
classes are combined to form a super-class.
• Declare primary key of higher-level table and the primary key for lower-level table.
7
Department of Computer Science & Information Technology
Implementation Question:-
Q.1 Draw the EER for SIU library management and convert into relational model.
Student
lid Stud id Name Email Phone no Year Dept
Fresher
lid Prn Stud id
Senior
lid Prn Stud id memid
Faculty
lid Name Email Phone no Dept
Staff
lid e Salary Emp id
Chairperson
lid Specialization
8
Department of Computer Science & Information Technology
Community
lid Mem id
Books
Book id Title Category Price Copies
Specialization
Spec id Spec name Book id
Student
SSN Name D.O.B GPA StartDate
Senior
SSN Major Advisor GPA
Freshman
SSN GPA
Junior
SSN Major GPA
Sophomore
SSN Major GPA
9
Department of Computer Science & Information Technology
Employee
SSN Name D.O.B Salary Department
Secretary
SSN Salary Department
Technician
SSN Specialization Department
10