database design - Normalization to 3NF from un-normalized relation -


given

insurance portfolio (portfolio id, insurance company name, insurance company phone, ((agent name, agent license number, state of residence, ((policy number, policy description, annual premium, benefit, beneficiary details)),  number of policies)), number of policies in portfolio) 

i'm trying 3nf. on right track?

1nf:

1nf: insurance portfolio:(portfolio id, insurance company name, insurance company phone, ,agentname, number of policies in portfolio)  agentdetails: (agent name, agent license number, state of residence, policy number,number of policies in portfolio#)  policydetails:(agent name#,policy number#, policy description, annual premium, benefit, beneficiary details) 

2nf

2nf: insurance portfolio:( agent name ,portfolio id, insurance company name, number of policies in portfolio)  agentdetails: (agent name, agent license number, state of residence, policynumber,number of policies in portfolio#)  policydetails:(agentname,policy number, policy description, annual premium, benefit, beneficiary details) 

3nf:

 insurance portfolio:( agent name ,portfolio id, phonenumber  , number of policies in portfolio)   agentdetails:(agent name#, agent license number, state of residence,policynumber,number of policies in portfolio#)  policydetails:(agent name#,policy number#, policy description, annual premium, benefit, beneficiary details) 

any guidance appreciated

your 1nf answer skips on 1nf , tries go 3nf directly. result, seem @ loss in 2nf , 3nf answers.

1nf doesn't introduce new relations (unless have nested tables can empty). eliminate nested rows. higher normal forms decompose relation.

your original schema has form:

r = (a, b, c, (d, e, f, (g, h, i, j, k), l), m) 

i'm assuming portfolios can't exist without policies, , policies can't exist without agents. converting 1nf should have form:

r = (a, b, c, d, e, f, g, h, i, j, k, l, m) 

and need choose suitable primary key every row in relation uniquely identified values of primary key. @ worst, combination of columns unique (i.e. there's key) in case should able find 1 3 columns or less, depending on associations between nested levels.

for 2nf, see if can find partial functional dependencies in 1nf schema. if chose primary key single column, relation in 2nf , can skip ahead. if there partial dependencies, split them off separate relations.

for 3nf, see if can find transitive functional dependencies in 2nf schema. if there any, split them off separate relations.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -