โšก IS211 ยท EER Model + Normalization ยท All 3 Finals Covered

Database Systems
EER Model & Normalization

2
Chapters
3
Finals (2023-25)
20+
Exam Questions
4
Mapping Options
01

Enhanced Entity-Relationship (EER) Model

Subclasses ยท Superclasses ยท Specialization ยท Generalization ยท Constraints ยท Mapping

๐Ÿ—๏ธ Subclasses & Superclasses โ€” ุงู„ููƒุฑุฉ ุงู„ุฃุณุงุณูŠุฉ

ุฃุญูŠุงู†ุงู‹ ุงู„ู€ entity type ุจูŠูƒูˆู† ููŠู‡ ุชุฌู…ูŠุนุงุช ุฃูˆ ุฃู†ูˆุงุน ูุฑุนูŠุฉ ู„ูŠู‡ ู…ุนู†ู‰ ุฅุถุงููŠ. ู…ุซู„ุงู‹:

Superclass (ุงู„ู†ูˆุน ุงู„ุฃุจ)

EMPLOYEE superclass
// EMPLOYEE entity has attributes:
Name, Ssn, Birth_date, Address

// Grouped into subclasses by JOB:
SECRETARY    โ†’ Typing_speed
TECHNICIAN   โ†’ Tgrade
ENGINEER     โ†’ Eng_type

// By MANAGEMENT role:
MANAGER      โ†’ manages PROJECT

// By PAY METHOD:
SALARIED_EMP โ†’ Salary
HOURLY_EMP   โ†’ Pay_scale
๐Ÿ“Œ ุงู„ู‚ุงุนุฏุฉ ุงู„ุฃุณุงุณูŠุฉ:
โ€ข ุงู„ู€ Subclass ุจุชู…ุซู„ ู†ูุณ ุงู„ู€ real-world entity ุจุณ ููŠ role ู…ุฎุชู„ู
โ€ข Entity ู…ุด ู…ู…ูƒู† ูŠูƒูˆู† ููŠ subclass ู„ูˆุญุฏู‡ โ€” ู„ุงุฒู… ูŠูƒูˆู† ููŠ ุงู„ู€ superclass ุงู„ุฃูˆู„
โ€ข Member ููŠ ุงู„ู€ superclass ู…ู…ูƒู† ูŠูƒูˆู† ููŠ ุฃูƒุชุฑ ู…ู† subclass ููŠ ู†ูุณ ุงู„ูˆู‚ุช

ู…ุซุงู„: ู…ูˆุธู ู…ู‡ู†ุฏุณ ูˆุจูŠุงุฎุฏ ู…ุฑุชุจ ุซุงุจุช โ†’ ููŠ ENGINEER + SALARIED_EMPLOYEE ู…ุนุงู‹
โš ๏ธ ุงุตุทู„ุงุญุงุช ู…ู‡ู…ุฉ:
Superclass = Supertype = ุงู„ุฃุจ
Subclass = Subtype = ุงู„ูุฑุน
ุงู„ุนู„ุงู‚ุฉ = superclass/subclass relationship
๐Ÿ“Š EER Diagram โ€” EMPLOYEE Specializations

ุฏู‡ ุงู„ู€ EER diagram ุงู„ุฃุณุงุณูŠ ุงู„ู„ูŠ ุจูŠุฌูŠ ููŠ ุงู„ุงู…ุชุญุงู†ุงุช. ุงูู‡ู…ู‡ ูƒูˆูŠุณ!

EMPLOYEE Name Ssn Birth_date d Job_type SECRETARY Typing_speed TECHNICIAN Tgrade ENGINEER Eng_type {SECRETARY, TECHNICIAN, ENGINEER} MGR {MANAGER} d Pay_type HOURLY_EMP SALARIED_EMP {HOURLY_EMP, SALARIED_EMP} LEGEND Superclass Subclass d Specialization
๐Ÿงฌ Inheritance โ€” ุงู„ูˆุฑุงุซุฉ

ุงู„ู€ entity ู„ู…ุง ุจูŠูƒูˆู† member ููŠ subclassุŒ ุจูŠูˆุฑู‘ุซ ูƒู„ ุญุงุฌุฉ ู…ู† ุงู„ู€ superclass:

SECRETARY entity gets:
// Inherited from EMPLOYEE (superclass):
Name       โ† inherited
Ssn        โ† inherited
Birth_date โ† inherited
Address    โ† inherited

// Specific/Local attribute (own):
Typing_speed โ† specific

// Inherited relationships:
WORKS_FOR Department โ† inherited
WORKS_ON  Project    โ† inherited
โœ… ู…ุง ุจูŠุชูˆุฑู‘ุซ
1. ูƒู„ ุงู„ู€ attributes ู…ู† ุงู„ู€ superclass
2. ูƒู„ ุงู„ู€ relationships ู…ู† ุงู„ู€ superclass
3. ูˆุฅุฐุง ูƒุงู†ุช ููŠ hierarchy: ุจูŠูˆุฑู‘ุซ ู…ู† ูƒู„ predecessor superclasses
๐Ÿ“Œ Specific vs Local Attributes
ุงู„ู€ attributes ุงู„ุฎุงุตุฉ ุจุงู„ู€ subclass ุจุชุชุณู…ู‰ "specific" ุฃูˆ "local" attributes.
ู…ุซุงู„: TypingSpeed ุจุชุงุนุฉ SECRETARY
ูˆุงู„ู€ subclass ู…ู…ูƒู† ูŠุดุงุฑูƒ ููŠ specific relationships ุฒูŠู‡ุง.
ู…ุซุงู„: HOURLY_EMP BELONGS_TO TRADE_UNION
๐Ÿ”„ Specialization vs Generalization โ€” ุงู„ูุฑู‚ ุงู„ู…ู‡ู…!

โฌ‡๏ธ Specialization

ุจูŠุจุฏุฃ ู…ู† ุงู„ู€ Superclass ูˆู†ุนุฑู‘ู ุงู„ู€ subclasses ู…ู†ู‡ุง.

ุงุชุฌุงู‡ Top-Down โ€” ู…ู† ููˆู‚ ู„ุชุญุช

EMPLOYEE d SECRETARY ENGINEER โฌ‡๏ธ Top-Down

โฌ†๏ธ Generalization

ุจูŠุจุฏุฃ ู…ู† entities ู…ุชุดุงุจู‡ุฉ ูˆู†ุนู…ู„ Superclass ู…ุดุชุฑูƒุฉ.

ุงุชุฌุงู‡ Bottom-Up โ€” ู…ู† ุชุญุช ู„ููˆู‚

VEHICLE Vehicle_id, Price, License d CAR Max_speed TRUCK No_of_axles โฌ†๏ธ Bottom-Up
๐Ÿšจ ุงู„ูุฎ ุงู„ู„ูŠ ุจูŠู‚ุน ููŠู‡ ุงู„ู†ุงุณ ููŠ ุงู„ุงู…ุชุญุงู†!
Specialization = ู…ู† superclass ู„ู„ู€ subclasses (Top-Down)
Generalization = ุฏู…ุฌ entities ููŠ superclass ูˆุงุญุฏุฉ (Bottom-Up)
ุงู„ุณุคุงู„ "Specialization is the process of generating a superclass from different subclasses" โ†’ ุงู„ุฌูˆุงุจ: FALSE! ุฏูŠ Generalization!
๐Ÿ”€ Disjointness Constraint โ€” ุงู„ู€ 'd' ูˆุงู„ู€ 'o'

ุงู„ู€ constraint ุฏูŠ ุจุชุญุฏุฏ: ู‡ู„ entity ู…ู…ูƒู† ูŠูƒูˆู† ููŠ ุฃูƒุชุฑ ู…ู† subclass ููŠ ู†ูุณ ุงู„ูˆู‚ุชุŸ

๐Ÿ”ต Disjoint (d) โ€” ู„ุง ุชุฏุงุฎู„

ุงู„ู€ entity ูŠูƒูˆู† ููŠ ูˆุงุญุฏุฉ ุจุณ ู…ู† ุงู„ู€ subclasses.

SECRETARY โ— โ— โ— ENGINEER โ— โ— ู…ููŠุด ุชุฏุงุฎู„ = ูุตู„ ุชุงู… d
ู…ูˆุธู ุงุณู…ู‡ ูƒู€ "Secretary" ู…ุด ู…ู…ูƒู† ูŠูƒูˆู† "Engineer" ููŠ ู†ูุณ ุงู„ูˆู‚ุช ููŠ ู†ูุณ ุงู„ู€ specialization

๐ŸŸก Overlapping (o) โ€” ุชุฏุงุฎู„ ู…ุณู…ูˆุญ

ุงู„ู€ entity ู…ู…ูƒู† ูŠูƒูˆู† ููŠ ุฃูƒุชุฑ ู…ู† subclass ููŠ ู†ูุณ ุงู„ูˆู‚ุช.

PT_EMP โ— โ— CONSULT โ— โ— โ— ุงู„ู…ู†ุทู‚ุฉ ุฏูŠ = ุงู„ุงุชู†ูŠู† ู…ุนุงู‹ o
ู…ูˆุธู ู…ู…ูƒู† ูŠูƒูˆู† Part-Time ูˆููŠ ู†ูุณ ุงู„ูˆู‚ุช Consultant โ†’ ูŠุธู‡ุฑ ููŠ ุงู„ุงุชู†ูŠู†
๐Ÿ“ Completeness Constraint โ€” Single Line vs Double Line

ุงู„ู€ constraint ุฏูŠ ุจุชุญุฏุฏ: ู‡ู„ ูƒู„ entities ููŠ ุงู„ู€ superclass ู„ุงุฒู… ุชูƒูˆู† ููŠ subclassุŸ

Single Line = Partial

ุจุนุถ ุงู„ู€ entities ููŠ ุงู„ู€ superclass ู…ู…ูƒู† ู…ุง ุชูƒูˆู†ุด ููŠ ุฃูŠ subclass.

EMPLOYEE d SECR. TECH. not in any subclass!
Notation
// In EER diagram: SINGLE LINE
EMPLOYEE โ”€โ”€โ”€ (d) โ†’ Subclasses

// Meaning:
Some EMPLOYEES have no subtype

Double Line = Total

ูƒู„ entity ููŠ ุงู„ู€ superclass ู„ุงุฒู… ุชูƒูˆู† ููŠ ุนู„ู‰ ุงู„ุฃู‚ู„ subclass ูˆุงุญุฏุฉ.

EMPLOYEE d SECR. TECH. = = (double)
Notation
// In EER diagram: DOUBLE LINE
EMPLOYEE โ•โ• (d) โ†’ Subclasses

// Meaning:
Every EMPLOYEE must be in โ‰ฅ1 subtype
๐Ÿ“ 4 Types of Specialization + Cardinality โ€” ุฃู‡ู… ุฌุฒุก ููŠ ุงู„ุงู…ุชุญุงู†!

Total / Disjoint (T/D)

ูƒู„ entity ููŠ superclass ููŠ exactly ONE subclass. ุงู„ู…ุฌู…ูˆุน = Total ุจุงู„ุธุจุท.

Sum = Total

Total / Overlapping (T/O)

ูƒู„ entity ููŠ superclass ููŠ ุนู„ู‰ ุงู„ุฃู‚ู„ ONE subclassุŒ ูˆู…ู…ูƒู† ุฃูƒุชุฑ. ุงู„ู…ุฌู…ูˆุน โ‰ฅ Total.

Sum โ‰ฅ Total

Partial / Disjoint (P/D)

ุจุนุถ entities ู…ุด ููŠ ุฃูŠ subclassุŒ ูˆูƒู„ entity ููŠ subclass ูˆุงุญุฏุฉ max. ุงู„ู…ุฌู…ูˆุน < Total.

Sum < Total

Partial / Overlapping (P/O)

ุงู„ุญุงู„ุฉ ุงู„ุฃุนู… โ€” ุจุนุถ entities ู…ุด ููŠ subclassุŒ ูˆู…ู…ูƒู† ุงู„ู…ูˆุฌูˆุฏูŠู† ูŠูƒูˆู†ูˆุง ููŠ ุฃูƒุชุฑ ู…ู† ูˆุงุญุฏุฉ.

Any case

๐Ÿ”ข Cardinality Formula โ€” ุงุชุญูุธู‡ุง!

ุจู†ูุชุฑุถ: Total Employees = 100, PartTime = 50, Consultant = 20

ุงู„ุณุคุงู„: ุฅูŠู‡ ู†ูˆุน ุงู„ู€ participation ู„ูˆ Permanent Employees = XุŸ

Sum = 50+20+X
ุญุณุงุจ ู…ุฌู…ูˆุน ูƒู„ ุงู„ู€ subtypes
Sum = 100 ุจุงู„ุธุจุท
โ†’ T/D (X = 30)
Sum > 100
โ†’ Overlapping (T/O ุฃูˆ P/O โ€” ู…ุด ูˆุงุถุญ ู…ู† ุงู„ุฃุฑู‚ุงู… ู„ูˆุญุฏู‡ุง)
Sum < 100
โ†’ Partial (P/D ู‡ูŠ ุงู„ุฃูˆุถุญ โ€” ุจุนุถ ู…ูˆุธููŠู† ู…ุด ู…ุชุตู†ููŠู†)

X = 29 โ†’ P/D

Sum = 99 < 100 โ†’ Partial

99 โ‰ค 100 โ†’ consistent with Disjoint

Partial / Disjoint

X = 81 โ†’ Overlapping

Sum = 151 > 100 โ†’ Overlapping

T ุฃูˆ P? ู…ุด ูˆุงุถุญ ู…ู† ุงู„ุฃุฑู‚ุงู…

Overlapping (T or P)

X = 30 โ†’ T/D

Sum = 100 = 100 โ†’ Total

ู„ุง overlap โ†’ Disjoint

Total / Disjoint โœ“
๐Ÿšจ ุงู„ู€ Trick ุงู„ู„ูŠ ุจูŠู‚ุน ููŠู‡ ุงู„ูƒู„!
ู„ู…ุง Sum < Total โ†’ ู…ุด ู…ู…ูƒู† Overlapping ูŠูƒูˆู† confirmed (ุจุณ ู…ู…ูƒู† ูŠูƒูˆู† P/D)
ู„ู…ุง Sum > Total โ†’ Overlapping ู…ุคูƒุฏ (P/O ุฃูˆ T/O ุญุณุจ Coverage)
ู„ู…ุง X = 30 ุจุงู„ุธุจุท โ†’ T/D ุงู„ูˆุญูŠุฏ ุงู„ู…ู…ูƒู†
๐Ÿ“‹ ู…ุซุงู„ ุงู„ุงู…ุชุญุงู† ุงู„ุตุนุจ (2025 Q31):
Total=100, PT=50, C=20, PE=40, intersection ุจูŠู† ุงู„ู€ 3 subtypes = 10 ู†ูุณ ุงู„ู€ records.
Sum = 110 > 100 โ†’ Overlapping ู…ุคูƒุฏ. ูˆุทุงู„ู…ุง ุงู„ู€ intersection = 10 โ†’ unique coverage = 110 - overlaps โ‰ฅ 100 โ†’ ุงู„ุชุบุทูŠุฉ Total.
Answer: Total / Overlapping
๐Ÿ—บ๏ธ Mapping EER to Relational Schema โ€” ุงู„ู€ 4 Options

ุนู†ุฏู†ุง specialization ููŠู‡ุง superclass C ูˆm subclasses {S1, S2, ..., Sm}. ุฅุฒุงูŠ ู†ุญูˆู„ู‡ุง ู„ู€ relational tablesุŸ

8A

Multiple Relations โ€” Superclass + Subclasses

ุงู„ุฎูŠุงุฑ ุงู„ุขู…ู† ุงู„ุดุงู…ู„ โœ…

m+1 relations
Result Tables
EMPLOYEE(SSN, Name, Bdate, Addr)
SECRETARY(SSN, Typing_speed)  โ† FK
TECHNICIAN(SSN, Tgrade)       โ† FK
ENGINEER(SSN, Eng_type)       โ† FK
โœ… Works for: ANY specialization
(Total or Partial) + (Disjoint or Overlapping)
ุงู„ู€ PK ุจุชุงุนุฉ ูƒู„ subclass ู‡ูˆ ู†ูุณ ุงู„ู€ PK ุจุชุงุนุฉ ุงู„ู€ superclass (foreign key)
8B

Multiple Relations โ€” Subclass Relations Only

ูƒู„ subclass ุจูŠุงุฎุฏ ูƒู„ attrs ุงู„ู€ superclass

m relations
Result Tables
SECRETARY(SSN, Name, Bdate, Typing_speed)
ENGINEER(SSN, Name, Bdate, Eng_type)
// NO separate EMPLOYEE table
โš ๏ธ Works ONLY for:
TOTAL specialization ูู‚ุท!
ู„ูˆ Partial โ†’ employees ู…ุด ููŠ ุฃูŠ subclass ู‡ูŠุชุถูŠุนูˆุง
ู„ูˆ Overlapping โ†’ ู†ูุณ ุงู„ู€ entity ู‡ูŠุชูƒุฑุฑ ููŠ ุฃูƒุชุฑ ู…ู† relation โ€” valid ุจุณ ู…ุด recommended
8C

Single Relation with ONE Type Attribute

table ูˆุงุญุฏุฉ ุจู€ discriminating attribute

1 relation
Result Table
EMPLOYEE(SSN, Name, Bdate,
  Typing_speed, Tgrade, Eng_type,
  Profession)  โ† type attribute

// Example data:
1 | Ahmed | ... | NULL  | Civil | Engineer
2 | Sara  | ... | 100   | NULL  | Secretary
โŒ Works ONLY for DISJOINT!
ู„ูˆ Overlapping โ†’ ูˆุงุญุฏ ุจูŠูƒูˆู† Secretary ูˆEngineer ู…ุนุงู‹ โ†’ type attr ูˆุงุญุฏ ู…ุด ูƒูุงูŠุฉ โ†’ violates uniqueness
ู„ุงุฒู… ุชุนู…ู„: PK = (SSN + Profession)
Total vs Partial: ู…ุด ู…ู‡ู… ู‡ู†ุง
8D

Single Relation with MULTIPLE Type Attributes

Boolean flag ู„ูƒู„ subclass

1 relation
Result Table
EMPLOYEE(SSN, Name, Bdate,
  Typing_speed, Tgrade, Eng_type,
  IsSecretary,   โ† YES/NO
  IsTechnician,  โ† YES/NO
  IsEngineer)    โ† YES/NO

// Example: engineer+secretary:
1 | Ahmed | 100 | Civil | YES | NO | YES
โœ… Works for BOTH:
Disjoint โœ… + Overlapping โœ…
ูƒู„ entity ุนู†ุฏู‡ m flags (YES/NO)
ุงู„ูุฑู‚ ุนู† 8C: ุจุฏู„ type attribute ูˆุงุญุฏุŒ ุนู†ุฏูƒ boolean flag ู„ูƒู„ subclass โ€” ูุงู„ู€ overlapping ุจูŠุชุญู„

๐Ÿ“Š Quick Summary Table โ€” ุงุญูุธู‡ุง!

Option# TablesTotalPartialDisjointOverlapping
8A m+1 โœ“ โœ“ โœ“ โœ“
8B m โœ“ required โœ— recommended valid, not recommended
8C 1 โœ“ โœ“ โœ“ required โœ—
8D 1 โœ“ โœ“ โœ“ โœ“
๐Ÿšจ ุงู„ุฃูƒุซุฑ ุณุคุงู„ุงู‹ ููŠ ุงู„ุงู…ุชุญุงู†ุงุช:
"Option 8C works for Overlapping" โ†’ FALSE! ูู‚ุท Disjoint
"Participation type doesn't affect the option" โ†’ FALSE! 8B requires Total
"Option 8A works for any type" โ†’ TRUE! โœ“
๐ŸŽฏ

EER Quiz โ€” ุฃุณุฆู„ุฉ ุญู‚ูŠู‚ูŠุฉ ู…ู† Finals 2023/2024/2025

ุงุฎุชุจุฑ ู†ูุณูƒ ุนู„ู‰ ูƒู„ ุงู„ู…ูุงู‡ูŠู… ุงู„ู„ูŠ ุงุชุดุฑุญุช

Q1 Final 2023 โ€” Q18
Specialization is the process of generating a superclass from different subclasses.
A True
B False
โœ… FALSE! ุฏู‡ ุชุนุฑูŠู ุงู„ู€ Generalization ู…ุด Specialization.
โ€ข Specialization = Top-Down: ู…ู† superclass ู„ู€ subclasses
โ€ข Generalization = Bottom-Up: ู…ู† entities ู…ุชุดุงุจู‡ุฉ ู†ุนู…ู„ superclass
Q2 Final 2024 โ€” Q37
An entity that is a member of a subclass inherits:
A All attributes of the entity as a member of the superclass
B All relationships of the entity as a member of the superclass
C All weak entities of the entity as a member of the superclass
D A and B
โœ… ุงู„ู€ subclass ุจุชูˆุฑู‘ุซ ุงู„ู€ attributes ูƒู„ู‡ุง + ุงู„ู€ relationships ูƒู„ู‡ุง ู…ู† ุงู„ู€ superclass. ู…ููŠุด ุญุงุฌุฉ ุงุณู…ู‡ุง "weak entities inheritance".
Q3 Final 2024 โ€” Q38 | Final 2023 โ€” Q20
Mapping Enhanced EER to SINGLE RELATION with ONE TYPE ATTRIBUTE (Option 8C) works for a specialization whose subclasses are:
A Total
B Disjoint
C Partial
D Overlapping
โœ… Option 8C ูŠุดุชุบู„ ูู‚ุท ู…ุน Disjoint. ู„ูˆ ูƒุงู† OverlappingุŒ entity ูˆุงุญุฏุฉ ู…ู…ูƒู† ุชูƒูˆู† ููŠ ุฃูƒุชุฑ ู…ู† subclass โ†’ type attribute ูˆุงุญุฏ ู…ุด ูƒูุงูŠุฉ โ†’ Uniqueness violation. Total vs Partial ู…ุด ู…ู‡ู… ู‡ู†ุง.
Q4 Final 2023 โ€” Q20
Building one table to represent inheritance with ONE TYPE ATTRIBUTE in EER can be used to enforce OVERLAPPING and PARTIAL PARTICIPATION constraints.
A True
B False
โœ… FALSE! One type attribute ูŠุดุชุบู„ ุจุณ ู…ุน Disjoint. Overlapping โ†’ ู…ุญุชุงุฌ Option 8D (multiple type attributes). ูƒู…ุงู† ู„ูˆ Partial ู…ุน Overlapping โ†’ ุงู„ู€ PK uniqueness ุจุชุชูƒุณุฑ (Dr. Ali's answer).
Q5 Final 2025 โ€” Q40
When converting EERD into relational model, the type of participation does NOT affect which option of the 4 conversion options is used.
A True
B False
โœ… FALSE! ุงู„ู€ participation type ู…ู‡ู…:
โ€ข Option 8B ูŠุดุชุบู„ ูู‚ุท ู…ุน Total participation
โ€ข Option 8A ูŠุดุชุบู„ ู…ุน ุฃูŠ type
โ€ข Options 8C ูˆ8D ู…ุด ู…ู‡ู… ููŠู‡ู… ุงู„ู€ Total/Partial
Q6 Final 2025 โ€” Q29 | Final 2024 โ€” Q28 | Final 2023 โ€” Q33
Assume 3 types of employees: PartTime, Permanent, Consultant. Total employees = 100, PartTime = 50, Consultant = 20. If number of Permanent = 29, the participation type is:
A Total / Disjoint
B Total / Overlapping
C Partial / Disjoint
D None of the above
โœ… Sum = 50 + 20 + 29 = 99 < 100
โ†’ Partial (ู…ูˆุธู ูˆุงุญุฏ ู…ุด ููŠ ุฃูŠ subtype)
โ†’ 99 โ‰ค 100 โ†’ consistent with Disjoint (ู…ููŠุด overlap ุถุฑูˆุฑูŠ)
โ†’ Partial / Disjoint โœ“
Q7 Final 2025 โ€” Q30 | Final 2024 โ€” Q29 | Final 2023 โ€” Q34
Same scenario: Total=100, PartTime=50, Consultant=20. If Permanent = 81, the participation type is:
A Total / Disjoint
B Total / Overlapping
C Partial / Disjoint
D Overlapping โ€” could be Total or Partial
โœ… Sum = 50 + 20 + 81 = 151 > 100
โ†’ Overlapping ู…ุคูƒุฏ (ุจุนุถ ุงู„ู…ูˆุธููŠู† ููŠ ุฃูƒุชุฑ ู…ู† subtype)
โ†’ ู‡ู„ Total ุฃูˆ PartialุŸ ู…ุด ูˆุงุถุญ ู…ู† ุงู„ุฃุฑู‚ุงู… ู„ูˆุญุฏู‡ุง โ†’ "Overlapping (T or P)"
Dr. Ali: "Overlapping and Maybe Partial or Total"
Q8 Final 2025 โ€” Q31
Total=100, PartTime=50, Consultant=20, Permanent=40. Intersection among ALL THREE subtypes = 10 records (same 10 records). The participation type is:
A Total / Disjoint
B Total / Overlapping
C Partial / Disjoint
D None of the above
โœ… Sum = 50 + 20 + 40 = 110 > 100 โ†’ Overlapping ู…ุคูƒุฏ
Intersection = 10 (ู†ูุณ 10 ู…ูˆุธููŠู† ููŠ ุงู„ู€ 3 types) โ†’ unique employees covered โ‰ฅ 100 โ†’ Total
โ†’ Total / Overlapping โœ“
Q9 โ€” EER Concept
Which mapping option creates the MAXIMUM number of relational tables?
A Option 8A
B Option 8B
C Option 8C
D Option 8D
โœ… Option 8A โ†’ m+1 tables (1 ู„ู„ู€ superclass + 1 ู„ูƒู„ subclass)
Option 8B โ†’ m tables
Options 8C ูˆ8D โ†’ 1 table ูู‚ุท
Q10 โ€” EER Concept
A member of a superclass CAN optionally be a member of any number of its subclasses.
A True
B False
โœ… TRUE! ู…ู† ุงู„ุณู„ุงูŠุฏุฒ: "A member of the superclass can be optionally included as a member of any number of its subclasses." โ€” ู…ุซุงู„: ู…ูˆุธู ู…ู‡ู†ุฏุณ ูˆู…ุฏูŠุฑ ูˆุจูŠุงุฎุฏ ู…ุฑุชุจ ุซุงุจุช โ†’ ููŠ 3 subclasses ู…ุนุงู‹.
02

Functional Dependencies & Normalization

Redundancy ยท FDs ยท 1NF ยท 2NF ยท 3NF

โš ๏ธ Redundancy & Anomalies โ€” ุงู„ู…ุดูƒู„ุฉ ุงู„ู„ูŠ ู‡ู†ุญู„ู‡ุง

ู„ู…ุง ุจู†ุญุท ู…ุนู„ูˆู…ุงุช ู…ุฎุชู„ูุฉ ููŠ table ูˆุงุญุฏุฉ ุจุชุญุตู„ Redundancy = ุชูƒุฑุงุฑ ุงู„ุจูŠุงู†ุงุช. ูˆุฏู‡ ุจูŠุณุจุจ 3 ู…ุดุงูƒู„:

โŒ Insertion Anomaly

ู…ุด ู…ู…ูƒู† ุชุถูŠู department ุฌุฏูŠุฏ ู…ู† ุบูŠุฑ employee โ€” ุงู„ู€ PK ู‡ูŠูƒูˆู† NULL ูˆุฏู‡ ู…ู…ู†ูˆุน!

โš ๏ธ Deletion Anomaly

ู„ูˆ ุญุฐูุช ุขุฎุฑ ู…ูˆุธู ููŠ departmentุŒ ุจุชุญุฐู ู…ุนุงู‡ ูƒู„ ู…ุนู„ูˆู…ุงุช ุงู„ู€ department!

๐Ÿ”„ Modification Anomaly

ู„ูˆ ุบูŠุฑุช ุงุณู… ุงู„ู€ departmentุŒ ู„ุงุฒู… ุชุบูŠุฑู‡ ููŠ ูƒู„ ุงู„ู€ rows โ€” ู†ุณูŠุงู† ูˆุงุญุฏ โ†’ inconsistency!

EMP_DEPT โ€” Example of Redundancy Problem
Ename        | Ssn       | Dnumber | Dname        | Dmgr_ssn
Smith        | 123456789 | 5       | Research     | 333445555
Wong         | 333445555 | 5       | Research     | 333445555  โ† repeated!
Narayan      | 666884444 | 5       | Research     | 333445555  โ† repeated!
English      | 453453453 | 5       | Research     | 333445555  โ† repeated!
// "Research" dept info repeated for EVERY employee in dept 5!
๐Ÿ”— Functional Dependencies (FD) โ€” ุงู„ุฃุณุงุณ

ุชุนุฑูŠู: X โ†’ Y ูŠุนู†ูŠ: ู„ูˆ tuple ุชุงู†ูŠู† ู„ูŠู‡ู… ู†ูุณ ู‚ูŠู…ุฉ XุŒ ู„ุงุฒู… ูŠูƒูˆู† ุนู†ุฏู‡ู… ู†ูุณ ู‚ูŠู…ุฉ Y.

FD Examples
// SSN determines all employee info:
SSN โ†’ Ename, Bdate, Address, Dnumber

// Department number determines dept info:
Dnumber โ†’ Dname, Dmgr_ssn

// Composite key determines hours:
{SSN, Pnumber} โ†’ Hours

โœ… Direct (Full) Dependency

ูƒู„ attribute ุจูŠุนุชู…ุฏ ุนู„ู‰ ุงู„ู€ PK ุจุงู„ูƒุงู…ู„

StudentId โ†’ Name, DOB, Address

โš ๏ธ Partial Dependency

attribute ุจูŠุนุชู…ุฏ ุนู„ู‰ ุฌุฒุก ู…ู† composite PK โ€” violates 2NF

SSN โ†’ Ename (ููŠ table PK={SSN,Pno})

๐Ÿ”„ Transitive Dependency

attribute ุจูŠุนุชู…ุฏ ุนู„ู‰ non-key attr โ€” violates 3NF

SSN โ†’ Dno โ†’ Dname

FD Diagram โ€” EMP_DEPT Table SSN Ename Bdate Address Dnumber Dnumber Transitive! Dname Dmgr_ssn Primary Key Direct deps Transitive via Dno
1๏ธโƒฃ First Normal Form (1NF)

ุงู„ู‚ุงุนุฏุฉ: ูƒู„ ุฎู„ูŠุฉ ููŠ ุงู„ู€ table ู„ุงุฒู… ุชูƒูˆู† atomic = ู‚ูŠู…ุฉ ูˆุงุญุฏุฉ ุจุณ.

โŒ ูŠุฎุงู„ู 1NF:
โ€ข Multi-valued attributes โ€” ู…ูˆุธู ุนู†ุฏู‡ ุฃูƒุชุฑ ู…ู† phone number ููŠ ุฎู„ูŠุฉ ูˆุงุญุฏุฉ
โ€ข Composite attributes โ€” ุงู„ู€ Name ู…ุด atomic
โ€ข Nested relations โ€” table ุฌูˆุง table
โ€ข Repeated groups โ€” ุฃูƒุชุฑ ู…ู† ู‚ูŠู…ุฉ ููŠ ู†ูุณ ุงู„ุฎู„ูŠุฉ
NOT in 1NF
// DEPARTMENT table โ€” multi-valued Dlocations:
Dnumber | Dname    | Dlocations
5       | Research | {Bellaire, Sugarland, Houston}
// โ†‘ NOT ATOMIC! Multiple values in one cell
โœ… Fix โ€” ู‚ุณู‘ู… ู„ู€ separate relations:
IN 1NF โ€” After fix
// DEPARTMENT:
Dnumber | Dname    | Dmgr_ssn

// DEPT_LOCATIONS (separate table):
Dnumber | Dlocation
5       | Bellaire
5       | Sugarland
5       | Houston
// PK = {Dnumber, Dlocation}
๐Ÿ“Œ ูŠู…ูŠู†: ู„ุงุฒู… ูŠูƒูˆู† ููŠ PK ู…ุญุฏุฏุฉ ุนุดุงู† ุชุนุชุจุฑ ุงู„ู€ relation in 1NF. ู…ู† ุบูŠุฑ PK โ†’ technically not 1NF
2๏ธโƒฃ Second Normal Form (2NF)

ุงู„ุดุฑุท: in 1NF + ู„ุง ูŠูˆุฌุฏ Partial Dependency

Partial Dependency = attribute ุจูŠุนุชู…ุฏ ุนู„ู‰ ุฌุฒุก ู…ู† ุงู„ู€ composite PK ุจุณุŒ ู…ุด ุงู„ู€ composite key ูƒู„ู‡.

โŒ EMP_PROJ โ€” violates 2NF:
Partial Dependencies Found!
// EMP_PROJ(SSN, Pnumber, Hours, Ename, Pname, Ploc)
// PK = {SSN, Pnumber}

{SSN, Pnumber} โ†’ Hours        โ† FULL โœ“
SSN            โ†’ Ename        โ† PARTIAL โœ—
Pnumber        โ†’ Pname, Ploc  โ† PARTIAL โœ—
โœ… Fix โ€” ูุตู‘ู„ ูƒู„ dependency ููŠ relation ู…ู†ูุตู„ุฉ:
2NF โ€” After Decomposition
// EP1: Full dependency only
EP1(SSN, Pnumber, Hours)
// {SSN, Pnumber} โ†’ Hours โœ“

// EP2: SSN partial dep
EP2(SSN, Ename)
// SSN โ†’ Ename โœ“

// EP3: Pnumber partial dep
EP3(Pnumber, Pname, Plocation)
// Pnumber โ†’ Pname, Ploc โœ“
Note: 2NF only relevant when PK is composite. Single PK โ†’ automatically in 2NF.
2NF Decomposition Visual EMP_PROJ โ€” NOT in 2NF [SSN, Pnumber] Hours Ename Pname, Ploc โ†“ Decompose [SSN,Pno] Hours EP1 โ€” full dep [SSN] Ename EP2 โ€” SSN partial dep [Pno] Pname, Ploc EP3 โ€” Pnumber partial dep
3๏ธโƒฃ Third Normal Form (3NF)

ุงู„ุดุฑุท: in 2NF + ู„ุง ูŠูˆุฌุฏ Transitive Dependency

Transitive Dependency = A โ†’ B โ†’ C ุญูŠุซ B ู‡ูŠ non-key attribute.

ุจู…ุนู†ู‰ ุชุงู†ูŠ: ู…ููŠุด non-key attribute ูŠุญุฏุฏ non-key attribute ุชุงู†ูŠ

โŒ EMP_DEPT โ€” violates 3NF:
Transitive Dependency Found!
// EMP_DEPT(Ename, SSN, Bdate, Addr, Dno, Dname, Dmgr)
// PK = SSN

SSN  โ†’ Ename, Bdate, Addr, Dno  โ† direct โœ“
Dno  โ†’ Dname, Dmgr_ssn            โ† Dno is non-key!

// So transitively:
SSN โ†’ Dno โ†’ Dname, Dmgr  โ† TRANSITIVE โœ—
โœ… Fix โ€” ุงูุตู„ ุงู„ู€ transitive dependency:
3NF โ€” After Fix
// ED1: Employee info (keep Dno as FK)
ED1(SSN, Ename, Bdate, Address, Dno)
// SSN โ†’ Ename, Bdate, Addr, Dno โœ“

// ED2: Department info (separate!)
ED2(Dno, Dname, Dmgr_ssn)
// Dno โ†’ Dname, Dmgr โœ“
๐Ÿงฉ ุงู„ู€ method:
1. ุญุฏุฏ ุงู„ู€ transitive deps
2. ูƒู„ transitive dep โ†’ relation ุฌุฏูŠุฏุฉ
3. ุงู„ู€ determinant (Dno) ูŠุจู‚ู‰ FK ููŠ ุงู„ู€ original table ูˆPK ููŠ ุงู„ุฌุฏูŠุฏุฉ
๐Ÿ“– Full Example โ€” Reservation System (ู…ู† ุงู„ุณู„ุงูŠุฏุฒ)

ู‡ู†ุงุฎุฏ ุงู„ู€ Reservation relation ุฏูŠ ูˆู†ุทุจู‚ ุนู„ูŠู‡ุง 2NF ูˆุจุนุฏูŠู† 3NF:

Original Relation + FDs
Reservation(PerformerId, AgentId, VenueId, EventId,
  PerformerName, PerformerLoc, PerformerType, Fee,
  AgentName, AgentLoc, EventType, EventName,
  VenueName, VenueLoc, BookingDate)

// FDs:
{PerformerId,AgentId,VenueId,EventId} โ†’ BookingDate
EventId      โ†’ EventType, EventName
VenueId      โ†’ VenueName, VenueLocation
AgentId      โ†’ AgentName, AgentLocation
PerformerId  โ†’ PerformerName, PerformerLoc, PerformerType
PerformerType โ†’ Fee

Step 1: 2NF โ€” Remove Partial Deps

After 2NF
Performer(PerformerId, PName, PLoc, PType, Fee)
Event(EventId, EventType, EventName)
Agent(AgentId, AgentName, AgentLoc)
Venue(VenueId, VenueName, VenueLoc)
Reservation(PerformerId, AgentId, VenueId,
            EventId, BookingDate)
Performer ู‡ู„ ู‡ูŠ in 3NFุŸ PerformerTypeโ†’Fee โ†’ Transitive! ู„ุงุฒู… ู†ูุตู„ู‡.

Step 2: 3NF โ€” Remove Transitive Deps

After 3NF
Performer(PerformerId, PName, PLoc, PType)
PerformerType(PerformerType, Fee) โ† new!
Event(EventId, EventType, EventName)
Agent(AgentId, AgentName, AgentLoc)
Venue(VenueId, VenueName, VenueLoc)
Reservation(PerformerId, AgentId, VenueId,
            EventId, BookingDate)
ุงู„ุขู† ูƒู„ relation in 3NF โ€” ู…ููŠุด partial ุฃูˆ transitive deps!

๐Ÿ” ูƒูŠู ุชุญุฏุฏ ุงู„ู€ Normal FormุŸ

Normal Formุงู„ุดุฑุท ุงู„ู„ูŠ ู„ุงุฒู… ูŠู†ุทุจู‚ุงู„ู€ Violation ุงู„ู„ูŠ ุจุชูƒุณุฑู‡ุง
1NFู‚ูŠู… atomic + PK ู…ุญุฏุฏุฉMulti-valued / composite attrs
2NFin 1NF + no partial depsNon-key attr depends on PART of composite PK
3NFin 2NF + no transitive depsNon-key attr determines another non-key attr
๐ŸŽฏ

Normalization Quiz โ€” ุฃุณุฆู„ุฉ ุญู‚ูŠู‚ูŠุฉ ู…ู† Finals 2023/2024/2025

ุงุฎุชุจุฑ ูู‡ู…ูƒ ู„ู„ู€ FDs ูˆุงู„ู€ Normal Forms

Q1 Final 2025 โ€” Q45 | Final 2024 | Final 2023 โ€” Q1
A functional dependency is a relationship between:
A Entities
B Attributes
C Tuples
D Tables
โœ… FD ู‡ูŠ relationship ุจูŠู† Attributes. X โ†’ Y ูŠุนู†ูŠ ูƒู„ ู…ุง ู‚ูŠู…ุฉ X ุชุชูƒุฑุฑุŒ ู†ูุณ ู‚ูŠู…ุฉ Y ุจุชุธู‡ุฑ. Dr. Ali: "c. Attributes"
Q2 Final 2025 โ€” Q46 | Final 2023 โ€” Q3
Every time a certain value of attribute A appears, it matches the same value of attribute B, but NOT the same value of C. Therefore it is true that:
A A โ†’ C
B B, C โ†’ A
C A โ†’ B
D A โ†’ B, C
โœ… ู„ู…ุง A ูŠุธู‡ุฑ โ†’ ู†ูุณ ู‚ูŠู…ุฉ B ุฏุงูŠู…ุงู‹ = A โ†’ B โœ“
ู„ู…ุง A ูŠุธู‡ุฑ โ†’ ู…ุด ู†ูุณ ู‚ูŠู…ุฉ C = A ู„ุง ูŠุญุฏุฏ C โ†’ A โ†’ C โœ—
Dr. Ali: c. A โ†’ B
Q3 Final 2025 โ€” Q47 | Final 2023 โ€” Q4
Given: StudentId โ†’ StuName, CourseId โ†’ CourseName, (StudentId, CourseId) โ†’ Grade. The 2NF decomposition is:
A (StudentId, StuName), (CourseId, CourseName), (StudentId, CourseId, Grade)
B (StudentId, StuName, Grade), (CourseId, CourseName), (StudentId, CourseId)
C (StudentId, StuName), (CourseId, CourseName, Grade), (StudentId, CourseId)
D (StudentId, CourseId), (StuName, CourseName, Grade)
โœ… PK = {StudentId, CourseId} โ€” composite
โ€ข StudentId โ†’ StuName = Partial dep โ†’ Student(StudentId, StuName)
โ€ข CourseId โ†’ CourseName = Partial dep โ†’ Course(CourseId, CourseName)
โ€ข {StudentId, CourseId} โ†’ Grade = Full dep โ†’ Enroll(StudentId, CourseId, Grade)
Dr. Ali: a
Q4 Final 2023 โ€” Q2
Given: {DEPT, COURSE, SECTION} โ†’ ROOM, INSTR and INSTR โ†’ I_OFFICE. The 3NF decomposition is:
A (DEPT, COURSE, SECTION, ROOM, INSTR), (INSTR, I_OFFICE)
B (DEPT, COURSE, SECTION, ROOM), (INSTR, I_OFFICE)
C (DEPT, COURSE, SECTION), (ROOM, INSTR), (INSTR, I_OFFICE)
D (DEPT, COURSE, SECTION), (INSTR, I_OFFICE, ROOM)
โœ… ุงู„ู€ transitive dependency ู‡ูŠ: PK โ†’ INSTR โ†’ I_OFFICE
Fix: ูุตู‘ู„ INSTR โ†’ I_OFFICE ููŠ relation ุฌุฏูŠุฏุฉ (INSTR, I_OFFICE)
ุงู„ู€ original table ุจูŠูุถู„ ูŠุญุชูุธ ุจู€ ROOM ูˆ INSTR (INSTR ุจู‚ู‰ FK)
Dr. Ali: a
Q5 Final 2024 โ€” Q20
A table stores StudentID (PK), CourseID (PK), StudentName, CourseName, and Grade where (StudentID, CourseID) is the composite key. Which statement is MOST TRUE?
A The table is already in 3NF
B The table suffers from partial dependency on StudentName
C The table is in 1NF but violates higher normal forms
D The table design is efficient and avoids unnecessary redundancy
โœ… ุงู„ู€ table in 1NF โœ“ (atomic values, PK defined)
ู„ูƒู†: StudentID โ†’ StudentName (Partial dep โ†’ violates 2NF)
CourseID โ†’ CourseName (Partial dep โ†’ violates 2NF)
โ†’ in 1NF but violates 2NF and 3NF
Dr. Ali: c
Q6 Final 2024 โ€” Q22 | Final 2025 โ€” Q23
A database D contains 3 entities: E1 in 2NF, E2 in 3NF, and E3 contains multi-valued attributes. The database is in:
A 1st Normal Form
B 2nd Normal Form
C 3rd Normal Form
D Denormalized
โœ… ุงู„ู€ DB ุจุชุงุฎุฏ ุงู„ู€ NF ุงู„ุฃุถุนู ุจูŠู† ุงู„ู€ tables.
E3 ุนู†ุฏู‡ุง multi-valued attributes โ†’ violates 1NF โ†’ below 1NF โ†’ Denormalized!
ู…ุด ู…ู‡ู… ุฅู† E1 in 2NF ูˆE2 in 3NF โ€” ุงู„ุฃุถุนู ู‡ูˆ ุงู„ู„ูŠ ุจูŠุญุฏุฏ.
Dr. Ali: a. Denormalized
Q7 Final 2024 โ€” Q24
Once the database model reaches Relational Model (with primary keys defined), all its relations are in at least:
A 1st Normal Form
B 2nd Normal Form
C 3rd Normal Form
D Denormalized
โœ… ู„ู…ุง ุงู„ู€ relation ุชูŠุฌูŠ ููŠ ุงู„ู€ Relational Model ู…ุน PK ู…ุญุฏุฏุฉ โ†’ ุงุชู„ุญู‚ุช ุจุดุฑูˆุท ุงู„ู€ 1NF (atomic values, defined key).
ู„ูƒู† ู…ุด ุถุงู…ู† 2NF ุฃูˆ 3NF (ู…ู…ูƒู† ูŠูƒูˆู† ููŠู‡ partial ุฃูˆ transitive deps).
Dr. Ali: a. 1st NF
Q8 โ€” Concept
Which type of dependency VIOLATES 2NF but NOT necessarily 1NF?
A Transitive dependency
B Full dependency
C Partial dependency
D Direct dependency
โœ… Partial Dependency = ูŠุฎุงู„ู 2NF (attr ูŠุนุชู…ุฏ ุนู„ู‰ ุฌุฒุก ู…ู† ุงู„ู€ composite PK).
Transitive = ูŠุฎุงู„ู 3NF.
Full/Direct dependency = ู…ุทู„ูˆุจุฉ ููŠ 2NF ูˆ3NF.
Q9 Final 2024 โ€” Q13
Table: (OrderID, ProductID, Quantity, UnitPrice, TotalPrice) where TotalPrice = Quantity ร— UnitPrice, and PK = (OrderID, ProductID). What normal form?
A 1st NF
B 2nd NF
C 3rd NF
D 0 NF
โœ… ุงู„ู€ table in 1NF (atomic values, PK defined) โœ“
ู„ูƒู†: UnitPrice โ†’ ู‡ูˆ ุณุนุฑ ุงู„ู…ู†ุชุฌุŒ ุจูŠุนุชู…ุฏ ุนู„ู‰ ProductID ูู‚ุท (ู…ุด ุงู„ู€ composite PK ูƒุงู…ู„) โ†’ Partial Dependency โ†’ violates 2NF
ูƒู…ุงู† TotalPrice ู…ุดุชู‚ุฉ (derived) ู…ู† Quantity ร— UnitPrice.
Dr. Ali: a. 1st NF
Q10 โ€” Concept
Which statement correctly describes 3NF?
A All attributes depend on the PRIMARY KEY only
B No attribute depends on part of a composite key
C In 2NF with no non-key attribute determining another non-key attribute
D All relations have a single primary key attribute
โœ… 3NF = in 2NF + no transitive dependencies = ู…ููŠุด {non-key โ†’ non-key}
Option A ูŠุตู 2NF ู†ูˆุนุงู‹ ู…ุง.
Option B ูŠุตู 2NF (removing partial deps).
Option C ู‡ูˆ ุงู„ุชุนุฑูŠู ุงู„ุตุญูŠุญ ู„ู„ู€ 3NF.
๐Ÿ“‹

Cheat Sheet โ€” ู…ู„ุฎุต ู„ู„ู…ุฑุงุฌุนุฉ ุงู„ุณุฑูŠุนุฉ

ุงุญูุธ ุงู„ุฌุฏูˆู„ ุฏู‡ ุงุฏุฎู„ ุงู„ุงู…ุชุญุงู† ุจุซู‚ุฉ!

๐Ÿ—๏ธ EER โ€” ุงู„ู…ูุงู‡ูŠู… ุงู„ุฃุณุงุณูŠุฉ

Specialization
Top-Down: ู…ู† Superclass ู„ู€ Subclasses โ€” ุจุชุนุฑู‘ู ุงู„ู€ subclasses
Generalization
Bottom-Up: ู…ู† entities ู…ุชุดุงุจู‡ุฉ ุชุนู…ู„ Superclass ูˆุงุญุฏุฉ
Inheritance
Subclass ุชุฑุซ ALL attributes + ALL relationships ู…ู† ุงู„ู€ Superclass
Local/Specific Attrs
ุงู„ู€ attributes ุงู„ุฎุงุตุฉ ุจุงู„ู€ subclass (ู…ุด ู…ูˆุฑูˆุซุฉ)
Subclass rule
ู„ุงุฒู… ุชูƒูˆู† member ููŠ ุงู„ู€ Superclass ุงู„ุฃูˆู„ โ€” ู…ุด ู…ู…ูƒู† ููŠ Subclass ู„ูˆุญุฏู‡ุง

๐Ÿ”€ Constraints โ€” ุงู„ู€ d ูˆ o ูˆุงู„ู€ single/double line

Disjoint (d)
Entity ููŠ ูˆุงุญุฏุฉ ุจุณ ู…ู† ุงู„ู€ subclasses โ€” ู„ุง ุชุฏุงุฎู„
Overlapping (o)
Entity ู…ู…ูƒู† ููŠ ุฃูƒุชุฑ ู…ู† subclass โ€” ุชุฏุงุฎู„ ู…ุณู…ูˆุญ
Total (double line โ•โ•)
ูƒู„ entity ููŠ ุงู„ู€ superclass ู„ุงุฒู… ููŠ ุนู„ู‰ ุงู„ุฃู‚ู„ subclass ูˆุงุญุฏุฉ
Partial (single line โ”€)
ุจุนุถ entities ู…ู…ูƒู† ู…ุง ุชูƒูˆู†ุด ููŠ ุฃูŠ subclass

๐Ÿ“ Cardinality Formula โ€” ุงู„ุณุคุงู„ ุงู„ู„ูŠ ุจูŠุฌูŠ ูƒู„ ุณู†ุฉ

Sum = Total ุจุงู„ุธุจุท
โ†’ Total / Disjoint (T/D)
Sum > Total
โ†’ Overlapping ู…ุคูƒุฏ (T/O ุฃูˆ P/O โ€” ู…ุด ูˆุงุถุญ)
Sum < Total
โ†’ Partial ู…ุคูƒุฏ (P/D ู‡ูŠ ุงู„ุฃูˆุถุญ)
T=100,PT=50,C=20,PE=29
Sum=99 < 100 โ†’ Partial/Disjoint โœ“
T=100,PT=50,C=20,PE=81
Sum=151 > 100 โ†’ Overlapping (T or P)
T=100,PT=50,C=20,PE=30
Sum=100 = 100 โ†’ Total/Disjoint โœ“

๐Ÿ—บ๏ธ Mapping Options โ€” ุงู„ู€ 4 ุฎูŠุงุฑุงุช

Option 8A
Superclass table + subclass tables = m+1 tables. ูŠุดุชุบู„ ู…ุน ANY type โœ…
Option 8B
Subclass tables only = m tables. ูŠุดุชุบู„ ู…ุน TOTAL ูู‚ุท. Recommended for D.
Option 8C
1 table + type attr. ูŠุดุชุบู„ ู…ุน DISJOINT ูู‚ุท. ู„ูˆ Overlapping โ†’ violates uniqueness.
Option 8D
1 table + m boolean flags. ูŠุดุชุบู„ ู…ุน D ูˆ O ู…ุนุงู‹ โœ…
Participation effect?
YES! 8B needs TOTAL. ุงู„ู€ participation type ุจูŠุฃุซุฑ ุนู„ู‰ ุงู„ู€ option ุงู„ู„ูŠ ุจู†ุฎุชุงุฑู‡.

๐Ÿ“Š Normal Forms Summary

1NF
Atomic values + PK defined. No multi-valued, composite, or nested attrs.
2NF
in 1NF + No PARTIAL dependencies (all non-key โ†’ full PK)
3NF
in 2NF + No TRANSITIVE dependencies (no non-key โ†’ non-key)
FD is between
ATTRIBUTES (ู…ุด entities ุฃูˆ tuples ุฃูˆ tables)
Partial dep
Attr depends on PART of composite PK โ†’ Fix by splitting
Transitive dep
PK โ†’ A โ†’ B where A is non-key โ†’ Fix by separating (A, B)
DB NF level
= ุงู„ู€ NF ู„ู„ู€ table ุงู„ุฃุถุนู. ู„ูˆ table in 1NF โ†’ DB in 1NF max
Multi-valued in table
โ†’ Denormalized (below 1NF) โ†’ DB is Denormalized

๐Ÿšจ Exam Traps โ€” ุงู„ุฃูƒุซุฑ ุบู„ุทุงู‹

"Spec. generates superclass"
โ†’ FALSE! ุฏู‡ Generalization. Specialization ุจุชุนู…ู„ Subclasses ู…ู† Superclass.
"8C works for Overlapping"
โ†’ FALSE! 8C ูู‚ุท ู„ู„ู€ Disjoint. Overlapping ู…ุญุชุงุฌ 8D.
"Participation doesn't matter"
โ†’ FALSE! 8B needs Total. Type of participation DOES matter.
Sum < Total โ†’ ู…ุคูƒุฏ P/D
โ†’ ู…ุด ุฏุงูŠู…ุงู‹! ูŠู…ูƒู† P/O โ€” ู„ูƒู† P/D ู‡ูˆ ุงู„ุฌูˆุงุจ ุงู„ุฃูˆุถุญ ููŠ ุงู„ุงู…ุชุญุงู†.
"FD between entities"
โ†’ FALSE! FD ุจูŠู† AttributesุŒ ู…ุด entities ุฃูˆ tables.
"2NF no transitive"
โ†’ FALSE! ุงู„ู€ transitive ูŠุฎุงู„ู 3NF ู…ุด 2NF. 2NF ุนู† ุงู„ู€ partial deps.
Subclass ูŠุฑุซ weak entities
โ†’ FALSE! ุจูŠุฑุซ attributes + relationships ุจุณ.
Single PK โ†’ 2NF auto?
โ†’ YES! ู„ูˆ PK ู…ุด composite โ†’ ู…ููŠุด partial deps ู…ู…ูƒู†ุฉ โ†’ automatically in 2NF.
SQL Basics
ER & Mapping
EER & Norm
โ†ฉ ุงู„ุนูˆุฏุฉ ู„ู„ุฑุฆูŠุณูŠุฉ