正在加载图片...
Keys ■LetKcR K is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R) Example:{ID}and {ID,name}are both superkeys of instructor. ■ Superkey K is a candidate key if K is minimal Example:{ID)is a candidate key for Instructor One of the candidate keys is selected to be the primary key. ·Vhich one? Foreign key constraint:Value in one relation must appear in another Referencing relation ·Referenced relation Example:dept name in instructor is a foreign key from instructor referencing department Database System Concepts-7th Edition 2.8 @Silberschatz,Korth and SudarshanDatabase System Concepts - 7 2.8 ©Silberschatz, Korth and Sudarshan th Edition Keys ▪ Let K  R ▪ K is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R) • Example: {ID} and {ID,name} are both superkeys of instructor. ▪ Superkey K is a candidate key if K is minimal Example: {ID} is a candidate key for Instructor ▪ One of the candidate keys is selected to be the primary key. • Which one? ▪ Foreign key constraint: Value in one relation must appear in another • Referencing relation • Referenced relation • Example: dept_name in instructor is a foreign key from instructor referencing department
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有