200 likes | 462 Views
BCNF and 3NF Decomposition and UML Design. -By Kishor, Rohit, CK. Test case 1. R = CGHRST F = { C --> T , CS --> G , HR --> C , HS --> R , HT --> R }. List of subschema after 3NF Synthesis: C, T C, S, G H, R, C H, S, R H, T, R. List of subschema after BCNF Decomposition: C, T
E N D
BCNF and 3NF Decompositionand UML Design -By Kishor, Rohit, CK
Test case 1 • R = CGHRST • F = { C --> T , CS --> G , HR --> C , HS --> R , HT --> R } • List of subschema after 3NF Synthesis: • C, T • C, S, G • H, R, C • H, S, R • H, T, R • List of subschema after BCNF Decomposition: • C, T • C, S, G • H, R, C • H, R, S • Lost Dependency: HT R
Test case 2 • Address, Course, Department, Grade, Hour, Level, Name, Phone, Room, STudent-id, Teacher, Units • R = ACDGHLNPRSTU • F = { C --> TU , S --> NAP , T --> LD , CS --> G , CS --> G , HS --> R , HT --> R } • List of subschema after 3NF Synthesis: • T, L, D • C, T, U • S, N, A, P • C, S, G • H, S, R • C, H, S • H, T, R • List of subschema after BCNF Decomposition: • T, L, D • T, C, U • S, N, A, P • C, S, G • H, S, R • C, H, S • Lost Dependency: H, T R
Test case 3 • R = ABCDE • F = { AB --> C , CD --> B , BC --> E } • List of subschema after 3NF Synthesis: • A, B, C • C, D, B • B, C, E • C, A, D • List of subschema after BCNF Decomposition: • B, A, D • B, C, E • A, B, C • Lost Dependency: CD B
Test case 4 • R = ABCDEG • F = { CD --> B , BE --> A } • List of subschema after 3NF Synthesis: • C, D, B • B, E, A • E, G, C, D • List of subschema after BCNF Decomposition: • C, D, B • C, D, E, A • E, G, C, D • Lost Dependency: BE A
Attributes • Franchise Name (A) • Player Name (B) • City (C) • Mascot (D) • Coach (E) • Conference (F) • Season (G) • Wins (H) • Losses (I) • Ties (M) • Jersey Number (J) • Player Position (K) • Player ID (L)
Dependencies • (Franchise Name) -> (City, Mascot, Conference) • (Player Id) -> (Player Name, Player Position) • (Player Id, Season) -> (Franchise Name) • (Player Id, Franchise Name, Season) -> (Jersey Number) • (Season, Franchise Name) -> (Wins, Losses, Ties, Coach)
BCNF Decomposition • Player Table • Player ID • Player Name • Position • Team Table • Franchise Name • City • Mascot • Conference • Player Season Stats • Player Id • Season • Franchise Name • Jersey Number • Team Season Stats • Franchise Name • Season • Coach • Wins • Losses • Ties
3NF • Same as BCNF
Relational schema from UML • Player: • PlayerID • PlayerName • Position • Team: • FranchiseName • City • Mascot • Conference • SeasonStats: • Season • FranchiseName • Coach • Wins • Losses • Ties • PlayerStats: • PlayerID • Season • FranchiseName • JerseyNo
UML to Relational Model • Player (Player ID, Player Name, hise Name, Season, Position) • Team (Franchise Name, City, Mascot, Coach, Conference, Season) • Standings (Team Name, Season, Conference, Wins, Losses, Ties, Rank )
Bank example Attributes: • Cname (C) • Street (S) • City (T) • Accno (A) • Bname (B) • Balance (N) • Bcity (Y) • Assets (E) • LoanNo (L) • LoanAmt (M)
Dependencies • Cname -> Street, City • Accno -> Banme, Cname, Balance • Bname -> Bcity, Assets • LoanNo -> Bname, Cname, LoanAmt
BCNF Decomposition • Customer • Cname • Street • Branch • Bname • Bcity • Assets • Deposit • Bname • Balance • Cname • AccNo • -Loan • LoanNo • LoanAmt • -??? • AcctNo • LoanNo
3NF • Same as BCNF
UML to Relational • Customer( Cname,Street, City) • Deposite (Accno ,Bname, Cname, Balance) • Branch (Bname , Bcity, Assets) • Borrow (LoanNo, Bname, Cname, LoanAmt)