- 0
- 0
- 约2千字
- 约 8页
- 2026-02-11 发布于北京
- 举报
2026/2/9DatabasePrinciplesProgramming12.4Keys,Superkeys,andNullValuesExample2.4.1.ConsiderthetableT:ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Assumeintentofdesigneristhatthistablewillremainwiththesamecontents.Thencandeterminekeysfromcontentalone(thisisaVERYUNUSUALsituation).
2026/2/9DatabasePrinciplesProgramming2Example2.4.1.(cont.)ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Nosinglecolumncanbeakey.………a2………a2………a1………a1DCBAIs‘A’akey?
2026/2/9DatabasePrinciplesProgramming3Example2.4.1.(cont.)……b1………b2………b2………b1…DCBAIs‘B’akey?ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Nosinglecolumncanbeakey.
2026/2/9DatabasePrinciplesProgramming4Example2.4.1.(cont.)…c2………c1………c2………c1……DCBAIs‘C’akey?ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Nosinglecolumncanbeakey.
2026/2/9DatabasePrinciplesProgramming5Example2.4.1.(cont.)d1………d1………d1………d1………DCBAIs‘D’akey?ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Nosinglecolumncanbeakey.
2026/2/9DatabasePrinciplesProgramming6Example2.4.1.(cont.)ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Nosinglecolumncanbeakey.NosetofcolumnscanbeakeyifitcontainsD.IfthesetofXandDisakey(thesetofXandDhasproperty1ofKEY)thenthesetofXhasproperty1ofKEY.
2026/2/9DatabasePrinciplesProgramming7Example2.4.1.(cont.)ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Pairs:AB,AC,BC.Eachofthesepairsdistinguishesallrows.Thereforeallarekeys.Nosinglecolumncanbeakey.NosetofcolumnscanbeakeyifitcontainsD.……b2a2……b1a2……b2a1……b1a1DCBAIs‘AB’akey?
2026/2/9DatabasePrinciplesProgramming8Example2.4.1.(cont.)ABCDa1b1c1d1a1b2c2d1a2b2c1d1a2b1c2d1Pairs:AB,AC,BC.Eachofthesepairsdistinguishesallrows.Thereforeallarekeys.Nosinglecolumncanbeakey.NosetofcolumnscanbeakeyifitcontainsD.Allothersets(musthave3ormoreelements)containoneoftheseorelseDasapropersubset.(Showsubsetlattice).Thereforenomorekeys.
原创力文档

文档评论(0)