
Fall2002–CS186 9/17/02
9/17/02-Version4-AS Page1
Solutions:
QuestionsontheOriginalSchema
1.Ifsay,concert1325nowhasJoeHendersonastheArtist,weneedtoupdateallthethreerecordswith
concert1325inthetable.Notupdatingallthethreerecordswillcauseananomaly.
2.EventhoughConcertdeterminesArtist,wecannotinsertanewticketholderunlessweknowbothConcert
andArtist.WealsocannotaddaConcertwithouthavingatleastoneticketholder.
3.WewillloseinformationsuchastheArtistforConcert1234andtheTheaterforDavidMurrayonJune7,
7:00PM(adeletionanomaly).
BCNFTesting&Decomposition
ToworkwithBCNF,weneedtoknowthesuperkeysofthisschema.
Abbreviatetheattributesby:
C–Concert,A–Artist,T–Theater,D–Date,H–Ticketholder,S–Seat
DenoteouroriginalrelationBaseasCATDHS.Wehavefunctionaldependencies:
C->A,CH->S,DH->C,DA->T,DT->C
NoticethatthereisnoDandHontheright-handsideofanyfunctionaldependencies.ThisimpliesthatifDand
Hcannotbedeterminedbyanyotherattributes,DHmustbepartofanycandidatekey.Indeed,DHistheonly
candidatekeyofthisrelation.
Wecancheck:DH->DH
DH->DHC(DH->C)
DH->DHAC(C->A)
DH->DACHS(CH->S)
DH->DACHST(DA->T)
SoanysetofattributescontainingDHisasuperkeyofthisrelation.
4.TocheckifDA->TviolatesBCNF,weneedtolookat2statements:
1)WhetherT
DA
2)WhetherDAisasuperkey.
Sincebothstatementsarefalse,weconcludethatDA->TviolatesBCNF.
5.WedecomposeCATDHSintoCADHSandATD.Base1representsthenewrelationATD.Base2represents
thenewrelationCADHS.Base1–Base2=TbecauseTcanbedeterminedbyAD.Base1 Base2=AD.