Skip to content
Unit 2 Syllabus Note· Introduction to Database System

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., Name into First_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., EMPLOYEE manages EMPLOYEE).
  • Binary: Relates two distinct entity sets (e.g., STUDENT enrolls in COURSE).
  • Ternary: Relates three entity sets simultaneously (e.g., SUPPLIER supplies PART for PROJECT).

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

  1. Strong Entity Set: Becomes a table with all simple attributes; key attribute becomes Primary Key.
  2. Composite Attributes: Flatten into individual simple column components.
  3. Multi-valued Attribute: Becomes a separate table containing (Foreign_Key_to_Owner, Multi_Valued_Attribute), with compound primary key.
  4. Weak Entity Set: Becomes a table containing its own partial discriminator plus the Primary Key of identifying strong entity as Foreign Key.
  5. 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).
  6. 1:N Relationship: Place the primary key of the '1' side as a Foreign Key into the table of the 'N' side.
  7. 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

  • STUDENT Belongs_To (N:1) DEPARTMENT (Total participation for Student).
  • PROFESSOR Works_In (N:1) DEPARTMENT.
  • PROFESSOR Teaches (1:N) COURSE.
  • STUDENT Enrolls_In (M:N) COURSE with attribute Grade.
  • PROFESSOR Heads (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

  • DOCTOR Works_In (N:1) DEPARTMENT.
  • DOCTOR Treats (M:N) PATIENT (Descriptive attribute: Consultation_Fee).
  • PATIENT Assigned_To (N:1) ROOM (Descriptive attributes: Admit_Date, Discharge_Date).
  • PATIENT Has (1:N) TREATMENT_RECORD (Identifying relationship).

3. Relational Table Schema Reduction

  1. DEPARTMENT ( Dept_ID, Dept_Name, Building )
  2. DOCTOR ( Doctor_ID, DoctorName, Specialization, Phone, *DeptID* )
  • Dept_ID references DEPARTMENT(Dept_ID).
  1. ROOM ( Room_No, RoomType, ChargePer_Day )
  2. PATIENT ( Patient_ID, Name, Address, DOB, BloodGroup, *RoomNo*, AdmitDate, DischargeDate )
  • Room_No references ROOM(Room_No).
  1. DOCTOR_PATIENT_TREATS ( *Doctor_ID, Patient_ID*, Consultation_Fee )
  • Compound PK: (Doctor_ID, Patient_ID) referencing respective parent tables.
  1. TREATMENT_RECORD ( *Patient_ID, Record_No*, Diagnosis, Date )
  • Compound PK: (Patient_ID, Record_No) referencing PATIENT(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.

Your reading progress
0%

100% left on this page — finishing it closes the gap for Entity-Relationship (E-R) Modeling & Conceptual Design.

Weak topic hint

Entity-Relationship (E-R) Modeling & Conceptual Design still counts as a weak topic until you finish this note and answer its questions.

Practise this unit
What Should You Do Next?

Test Your Understanding

Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.