Informal Design Guidelines For Relation Schemas
Informal Design Guidelines For Relation Schemas
GUIDELINE 1: Design a relation schema so that it is easy to explain its meaning. Do not combine attributes from multiple entity types and relationship types into a single relation. Intuitively, if a relation schema corresponds to one entity type or one relationship type, the meaning tends to be clear. Otherwise, the relation corresponds to a mixture of multiple entities and relationships and hence becomes semantically unclear.
FD1 FD2
FD3
LOTS1
PROPERTY_ID COUNTY_NAME
FD4
LOT# AREA PRICE
FD4
FD3
FD1 FD2
LOTS1A
PROPERTY_ID COUNTY_NAME
FD4
LOT# AREA
FD4
A relation schema R is in BCNF if, whenever a nontrivial FD X A holds in R, then X is a super key of R.
Normalization to BCNF
LOTS1A
PROPERTY_ID COUNTY_NAME LOT# AREA
FD1
LOTS1AY
AREA COUNTY_NAME
FD5
4.
5.
Repeat the following loop until a complete loop execution results in no changes to S {for each FD XY in F {for all rows in S which have the same symbols in the columns corresponding to attributes in X { make the symbols in each column that correspond to an attribute in Y be the same in all these rows as follows: if any of the rows has an a symbol for the column, set the other rows to that same a symbol in the column. If no a symbol exists for the attribute in any of the rows, choose one of the b symbols that appear in one of the rows for the attribute and set the other rows to that same b symbol in the column ;};};}; If a row is made up entirely of a symbols, then the decomposition has the lossless join property ;otherwise, it does not
An Example
R = {SSN, ENAME, PNUMBER, PNAME, PLOCATION, HOURS} R1 = EMP_LOCS={ENAME, PLOCATION} R2 = EMP_PROJ1={SSN, PNUMBER, HOURS, PNAME, PLOCATION} F={SSNENAME; PNUMBER{PNAME,PLOCATION}; {SSN,PNUMBER}HOURS}
SSN R1 R2 B1 a1
ENAME a2 b22
PNUMBER b13 a3
PNAME b14 a4
PLOCATION a5 a5
HOURS b16 a6
Another Example
R = {SSN, ENAME, PNUMBER, PNAME, PLOCATION, HOURS} R1 = EMP={SSN, ENAME} R2 = PROJ={PNUMBER, PNAME, PLOCATION} R3 = WORKS_ON = {SSN, PNUMBER, HOURS} F= { SSNENAME; PNUMBER{PNAME,PLOCATION}; {SSN,PNUMBER}HOURS }