Database Management Systems HW assignment #3 solution

Database Management Systems HW assignment #3 solution - b...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Read the Henry Books Case in DMC Chap 1 (from Page 14 to Page 22). There are six relations in the Henry Books Case (Publisher Relation, Author Relation, Book Relation, Wrote Relation, Branch Relation, Copy Relation). a. Identify the candidate keys of each relation. b. Identify the primary key and any alternate keys of each relation. c. How many foreign keys does each relation have? d. Identify the foreign keys of each relation. e. Indicate any instances in which a foreign key serves as part of the primary key of the relation in which it is a foreign key. Why does each of those relations require a multi- attribute primary key? f. Identify the relations that support many-to-many relationships, the primary keys of those relations, and any intersection data (non-primary keys). Solution:
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
a. PUBLISHER: Publisher Code; Publisher Name. AUTHOR: Author Num. BOOK: BookCode. WROTE: BookCode; AuthorNum (a two-field candidate key). BRANCH: BranchNum; BranchName. COPY: BookCode, BranchNum, CopyNum (a three-field candidate key).
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b. PUBLISHER: Publisher Code is the primary key; Publisher Name is the alternate key. AUTHOR: Author Num is the primary key. BOOK: BookCode is the primary key. WROTE: BookCode; AuthorNum (a two-field composite key) is the primary key. BRANCH: BranchNum is the primary key; BranchName is the alternate key. COPY: BookCode, BranchNum, CopyNum (a three-field composite key) is the primary key. c. PUBLISHER: 0 AUTHOR: 0 BOOK: 1 WROTE: 2 BRANCH: 0 COPY: 2 d. BOOK: PublsiherCode WROTE: BookCode, AuthorNum COPY: BookCode, BranchNum e. In both the WROTE and COPY relations, both parts of the primary key are also foreign keys. In WROTE it is BookCode and AuthorNum. In COPY it is BookCode and BranchNum. This is because both of these relations represent many-to-many relationships. f. WROTE relation. Primary key: BookCode, AuthorNum. Intersection data: Sequence. COPY relation. Primary key: BookCode, BranchNum and CopyNum. Intersection data: Quality and Price....
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern