Introduction to Database System
Comprehensive exam revision notes for BCA-104N Unit 2 (Entity-Relationship (E-R) Modeling & Conceptual Design). Includes Section A (2M), Section B (5M), and Section C (15M) questions, answers, and diagrams.
Introduction to Database System
Entity-Relationship (E-R) Modeling & Conceptual Design
Core Definitions & Key Concepts
An Entity, Entity Type, and Entity Set in E-R modeling
- Entity: A distinguishable real-world object or concept (e.g., student John).
- Entity Type: A collection of entities sharing identical attributes (e.g.,
STUDENT). - Entity Set: The current collection of all entities of an entity type in the database at a specific instant.
Strong Entity Set and Weak Entity Set
- Strong Entity Set: Has a primary key sufficient to uniquely identify its entities independently (represented by a single rectangle).
- Weak Entity Set: Lacks a primary key of its own; relies on an identifying owner entity and a partial key (discriminator) (represented by a double rectangle).
Simple vs Composite and Single-Valued vs Multi-Valued Attributes
- Simple: Atomic, indivisible (e.g.,
Age,Salary). - Composite: Can be divided into smaller subparts (e.g.,
NameintoFirst_Name,Last_Name). - Single-Valued: Holds a single value per entity (e.g.,
DOB). - Multi-Valued: Can hold multiple values for a single entity (e.g.,
Phone_Numbers,Degrees; drawn as double ellipse).
Stored and Derived Attributes with examples
- Stored: Saved directly in physical storage (e.g.,
Date_of_Birth). - Derived: Computed dynamically on demand from stored attributes (e.g.,
Age = Current_Date - Date_of_Birth; drawn as dashed ellipse).
Relationship Degree: Unary, Binary, and Ternary relationships
- Unary (Recursive): An entity set relates to itself (e.g.,
EMPLOYEEmanagesEMPLOYEE). - Binary: Relates two distinct entity sets (e.g.,
STUDENTenrolls inCOURSE). - Ternary: Relates three entity sets simultaneously (e.g.,
SUPPLIERsuppliesPARTforPROJECT).
Mapping Cardinalities (1:1, 1:N, N:1, M:N)
Cardinality ratio expresses the number of entity instances to which another entity instance can be associated via a relationship set: One-to-One, One-to-Many, Many-to-One, or Many-to-Many.
Differentiate Total Participation from Partial Participation
- Total Participation (Existence Dependency): Every entity in the set must participate in at least one relationship instance (drawn as double lines).
- Partial Participation: Some entities may not participate in any relationship instance (drawn as single line).
State the standard E-R Diagram symbols for Entity, Weak Entity, Attribute, Key Attribute, and Relationship
- Entity: Rectangle | Weak Entity: Double Rectangle
- Attribute: Ellipse | Key Attribute: Ellipse with underlined text
- Multi-valued Attribute: Double Ellipse | Derived Attribute: Dashed Ellipse
- Relationship: Diamond | Identifying Relationship: Double Diamond
Conceptual & Architectural Analysis
The step-by-step Rules for Reducing an E-R Diagram into Relational Tables
- Strong Entity Set: Becomes a table with all simple attributes; key attribute becomes Primary Key.
- Composite Attributes: Flatten into individual simple column components.
- Multi-valued Attribute: Becomes a separate table containing
(Foreign_Key_to_Owner, Multi_Valued_Attribute), with compound primary key. - Weak Entity Set: Becomes a table containing its own partial discriminator plus the Primary Key of identifying strong entity as Foreign Key.
- 1:1 Relationship: Place the primary key of one side as a foreign key into the table of the other side (preferably the side with total participation).
- 1:N Relationship: Place the primary key of the '1' side as a Foreign Key into the table of the 'N' side.
- M:N Relationship: Becomes a distinct Bridge (Junction) Table whose primary key is the combination of primary keys from both participating entity sets.
Design an E-R Schema for a University Management System
1. Participating Entity Sets & Attributes
- STUDENT:
Roll_No(PK),Name(Fname,Lname),DOB,Age(Derived),{Phone_No}(Multivalued). - DEPARTMENT:
Dept_Code(PK),Dept_Name,Office_Location. - COURSE:
Course_ID(PK),Title,Credits. - PROFESSOR:
Emp_ID(PK),Name,Designation,Salary.
2. Relationships & Cardinalities
STUDENTBelongs_To (N:1)DEPARTMENT(Total participation for Student).PROFESSORWorks_In (N:1)DEPARTMENT.PROFESSORTeaches (1:N)COURSE.STUDENTEnrolls_In (M:N)COURSEwith attributeGrade.PROFESSORHeads (1:1)DEPARTMENT.
In-Depth Analysis & Implementation
Construct a comprehensive, end-to-end Enterprise E-R Diagram for a Hospital Management System and reduce it completely into Relational Tables with primary and foreign keys
1. Requirements & Entities
- PATIENT:
Patient_ID(PK),Name,Address,DOB,Blood_Group. - DOCTOR:
Doctor_ID(PK),Doctor_Name,Specialization,Phone. - DEPARTMENT:
Dept_ID(PK),Dept_Name,Building. - ROOM / BED:
Room_No(PK),Room_Type(ICU, General),Charge_Per_Day. - TREATMENT_RECORD (Weak Entity): Dependent on
PATIENT. Discriminator:Record_No. Attributes:Diagnosis,Date.
2. Relationships
DOCTORWorks_In (N:1)DEPARTMENT.DOCTORTreats (M:N)PATIENT(Descriptive attribute:Consultation_Fee).PATIENTAssigned_To (N:1)ROOM(Descriptive attributes:Admit_Date,Discharge_Date).PATIENTHas (1:N)TREATMENT_RECORD(Identifying relationship).
3. Relational Table Schema Reduction
DEPARTMENT( Dept_ID, Dept_Name, Building )DOCTOR( Doctor_ID, DoctorName, Specialization, Phone, *DeptID* )
- Dept_ID references
DEPARTMENT(Dept_ID).
ROOM( Room_No, RoomType, ChargePer_Day )PATIENT( Patient_ID, Name, Address, DOB, BloodGroup, *RoomNo*, AdmitDate, DischargeDate )
- Room_No references
ROOM(Room_No).
DOCTOR_PATIENT_TREATS( *Doctor_ID, Patient_ID*, Consultation_Fee )
- Compound PK:
(Doctor_ID, Patient_ID)referencing respective parent tables.
TREATMENT_RECORD( *Patient_ID, Record_No*, Diagnosis, Date )
- Compound PK:
(Patient_ID, Record_No)referencingPATIENT(Patient_ID).
Important Exam Points & Quick Revision
In BCA-104N Unit 2, designing an E-R diagram for a University, Bank, or Hospital and reducing it to Relational Tables with underlined primary keys and italicized foreign keys is a 10–15 mark staple. Always explicitly state all reduction rules used.
100% left on this page — finishing it closes the gap for Entity-Relationship (E-R) Modeling & Conceptual Design.
Entity-Relationship (E-R) Modeling & Conceptual Design still counts as a weak topic until you finish this note and answer its questions.
Practise this unitTest Your Understanding
Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.