ER Modeling Viva Questions and Answers
Basic ER Modeling Questions
1. What is an Entity-Relationship (ER) Model?
Answer: The ER Model is a conceptual model used for designing databases. It represents the
logical structure of a database by showing entities, their attributes, and relationships between
them. It provides a visual representation of how data is organized and connected in a database
system.
2. What are the main components of an ER Diagram?
Answer: The three main components are:
Entity: Real-world objects (represented by rectangles)
Attribute: Properties of entities (represented by ovals)
Relationship: Connections between entities (represented by diamonds)
3. Differentiate between Entity and Attribute.
Answer:
Entity: A real-world object that can be stored as data (e.g., Student, Course, Employee)
Attribute: Properties or characteristics that describe an entity (e.g., StudentID, Name, Age)
4. What are the types of entities in ER modeling?
Answer:
Strong Entity: Has a primary key and can exist independently (represented by single
rectangle)
Weak Entity: Cannot exist independently, depends on strong entity (represented by double
rectangle)
5. Explain different types of attributes.
Answer:
Simple Attribute: Cannot be divided further (e.g., Age)
Composite Attribute: Can be divided into sub-parts (e.g., Address = Street + City + State)
Single-valued Attribute: Has only one value (e.g., StudentID)
Multi-valued Attribute: Can have multiple values (e.g., Phone numbers)
Derived Attribute: Calculated from other attributes (e.g., Age from Date of Birth)
Relationship Types and Cardinality
6. What are the different types of relationships?
Answer:
One-to-One (1:1): Each entity instance relates to exactly one instance of another entity
One-to-Many (1:N): One entity instance relates to multiple instances of another entity
Many-to-One (N:1): Multiple instances of one entity relate to one instance of another
Many-to-Many (M:N): Multiple instances of both entities can relate to each other
7. How do you represent a Many-to-Many relationship in a database?
Answer: Many-to-Many relationships are resolved by creating an associative entity (junction
table) that connects the two related entities. This intermediary entity contains foreign keys from
both related entities.
8. What is cardinality in ER modeling?
Answer: Cardinality defines the maximum number of relationship instances that an entity can
participate in. It specifies how many entities of one type can be associated with entities of
another type.
9. Explain participation constraints.
Answer:
Total Participation: Every entity must participate in the relationship (shown by double line)
Partial Participation: Some entities may not participate in the relationship (shown by single
line)
Advanced ER Concepts
10. What is a recursive relationship?
Answer: A recursive relationship exists when an entity has a relationship with itself. For example,
an Employee entity where some employees manage other employees (Manager-Subordinate
relationship).
11. What are specialization and generalization?
Answer:
Specialization: Top-down approach where a higher-level entity is divided into lower-level
specialized entities
Generalization: Bottom-up approach where lower-level entities are combined into a higher-
level generalized entity
12. What is an aggregation in ER modeling?
Answer: Aggregation treats a relationship as a higher-level entity, allowing relationships to
participate in other relationships. It's used when you need to model relationships between
relationships.
Database Design Questions
13. How do you convert an ER diagram to relational tables?
Answer:
Each entity becomes a table
Attributes become columns
Primary keys are identified
Foreign keys are created for relationships
Many-to-many relationships require separate junction tables
14. What steps do you follow to create an ER diagram?
Answer:
1. Identify entities
2. Identify relationships between entities
3. Determine cardinality and participation constraints
4. Identify attributes for each entity
5. Identify primary keys
6. Create the ER diagram
7. Review and refine
15. Why are ER diagrams important in database design?
Answer:
Provide visual representation of database structure
Help identify data requirements
Facilitate communication between stakeholders
Serve as blueprint for database implementation
Help identify potential design issues early
Practical Scenario Questions
16. Design an ER diagram for a Library Management System.
Answer: Key entities would include:
Book (BookID, Title, Author, ISBN)
Member (MemberID, Name, Address, Phone)
Borrowing (BorrowID, BorrowDate, ReturnDate)
Relationships: Member BORROWS Book (Many-to-Many)
17. How would you model a University database?
Answer: Main entities:
Student (StudentID, Name, Email)
Course (CourseID, CourseName, Credits)
Instructor (InstructorID, Name, Department)
Enrollment (EnrollmentID, Grade, Semester)
Relationships: Student ENROLLS IN Course, Instructor TEACHES Course
18. What is the difference between logical and physical data models?
Answer:
Logical Model: Shows what data is stored and relationships, independent of how it's
implemented
Physical Model: Shows how data is actually stored in the database, including indexes,
constraints, and storage details
Interview Tips
19. Common mistakes to avoid in ER modeling?
Answer:
Not identifying all entities and relationships
Incorrect cardinality specification
Missing primary keys
Not handling many-to-many relationships properly
Over-complicating the design
20. How do you handle complex business rules in ER diagrams?
Answer:
Use constraints and business rules documentation
Consider using triggers and stored procedures
Implement validation rules at application level
Use CHECK constraints in database design
Sample Viva Questions for Tomorrow
1. Draw an ER diagram for an online shopping system
2. Explain how you would convert a many-to-many relationship to database tables
3. What's the difference between strong and weak entities? Give examples
4. How do you represent inheritance in ER diagrams?
5. Design a database for a hospital management system
6. Explain the concept of foreign keys in relational databases
7. What are the advantages of using ER modeling?
8. How do you handle recursive relationships in database design?
9. What is normalization and how does it relate to ER modeling?
10. Explain the difference between identifying and non-identifying relationships
Good luck with your viva tomorrow! Remember to:
Draw clear diagrams
Explain your reasoning
Give practical examples
Be confident in your answers
Ask for clarification if needed
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]
1. [Link]
2. [Link]
3. [Link]
4. [Link]
5. [Link]
6. [Link]
7. [Link]
8. [Link]
9. [Link]
10. [Link]
11. [Link]
12. [Link]
13. [Link]
14. [Link]
15. [Link]