【正文】
: {ISBN, Title, Price} Functional Dependencies: {ISBN} ? {Title} {ISBN} ? {Price} Example 2 Functional Dependencies 1 Big House 9999999999 2 Small House 1234567890 3 Alpha Press 1111111111 PubID PubName PubPhone Table Scheme: {PubID, PubName, PubPhone} Functional Dependencies: {PubId} ? {PubPhone} {PubId} ? {PubName} {PubName, PubPhone} ? {PubID} AuID AuName AuPhone 6 Joyce 6666666666 7 Roman 4444444444 5 Smith 6542233455 4 Jones 1233333333 3 Grumpy 6652356532 2 Snoopy 2322341234 1 Sleepy 3213211111 Example 3 Table Scheme: {AuID, AuName, AuPhone} Functional Dependencies: {AuId} ? {AuPhone} {AuId} ? {AuName} {AuName, AuPhone} ? {AuID} FD – Example Database to track reviews of papers submitted to an academic conference. Prospective authors submit papers for review and possible acceptance in the published conference proceedings. Details of the entities – Author information includes a unique author number, a name, a mailing address, and a unique (optional) address. – Paper information includes the primary author, the paper number, the title, the abstract, and review status (pending, accepted,rejected) – Reviewer information includes the reviewer number, the name, the mailing address, and a unique (optional) address – A pleted review includes the reviewer number, the date, the paper number, ments to the authors, ments to the program chairperson, and ratings (overall, originality, correctness, style, clarity) FD – Example Functional Dependencies – AuthNo ? AuthName, AuthEmail, AuthAddress – AuthEmail ? AuthNo – PaperNo ? PrimaryAuthNo, Title, Abstract, Status – RevNo ? RevName, RevEmail, RevAddress – RevEmail ? RevNo – RevNo, PaperNo ? AuthComm, ProgComm, Date, Rating1, Rating2, Rating3, Rating4, Rating5 For a table to be in 2NF, there are two requirements – The database is in first normal form – All nonkey attributes in the table must be functionally dependent on the entire primary key Note: Remember that we are dealing with nonkey attributes Example 1 (Not 2NF) Scheme ? {Title, PubId, AuId, Price, AuAddress} 1. Key ? {Title, PubId, AuId} 2. {Title, PubId, AuID} ? {Price} 3. {AuID} ? {AuAddress} 4. AuAddress does not belong to a key 5. AuAddress functionally depends on AuId which is a subset of a key Second Normal Form (2NF) Example 2 (Not 2NF) Scheme ? {City, Street, HouseNumber, HouseColor, CityPopulation} 1. key ? {City, Street, HouseNumber} 2. {City, Street, HouseNumber} ? {HouseColor} 3. {City} ? {CityPopulation} 4. CityPopulation does not belong to any key. 5. CityPopulation is functionally dependent on the City which is a proper subset of the key Example 3 (Not 2NF) Scheme ? {studio, movie, budget, studio_city} 1. Key ? {studio, movie} 2. {studio, movie} ? {budget} 3. {studio} ? {studio_city} 4. studio_city is not a part of a key 5. studio_city functionally depends on studio which is a proper subset of the key Second Normal Form (2NF) 1. If a data item is fully functionally dependent on only a part of the primary key, move that data item and that part of the primary key to a ne