문제

I have following relation. A company has several employees. Each employee is defined by its employee number ENr and he is living on an address EAddress with a ZipCode ZZipCode. The City with the ZipCode is an own table because otherwise there is redundancy in table Employee. Therefore ZZipCode is a foreign key in Employee.

A Group is defined by its GGroupId, therefore that is the primary key. Each group has one group leader which can be any employee. Therefore ENr is a foreign key.

Each employee can work on none, one or more groups. For this reason the table GroupMember exists where the the tuple ENr and GGroupID define the primary key and both are foreign keys (I cannot do both, bold and italic).

And last, a product is defined by its product id PId and is associated to a group GGroupID.

Well here are the relations for that written description.

Employe(ENr, EName, EGender, EAddress, ZZipCode, ESocNr, ESalery)
Group(GGroupId, GName, GCostNr, ENr)
GroupMember(ENr, GGroupID) #both members are foreign keys too!
Product(PId, PName, PPrice, GGRoupId)
Zip(ZZipCode, ZCityName, SStateID)
State(SStateID, SStateName)

For clarification: bold members are primary keys and italic members are foreign keys.

I tried to put that relation into 3NF. Can anyone confirm that this is right?

도움이 되었습니까?

해결책

This seems to be good and normalised. I dont see any further division of the tables.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top