Account number branch name and balance in it branch

Info icon This preview shows pages 9–11. Sign up to view the full content.

View Full Document Right Arrow Icon
account- number , branch-name and balance ) in it. branch account customer branch-name account-number branch-name customer-name balance customer-name branch-city assets customer-street customer-city Note that the branch-name attribute in account table refers to the branch-name attribute in branch table. So, branch-name should uniquely identify each record in branch table. In other words, branch-name should be a primary key. Let’s assume branch-name is unique for the bank, i.e., all the branches of the bank have different names. So, we can say that branch-name is a primary key in branch table, and hence, a foreign key in account table. Again, the customer-name attribute in account table refers to the customer-name attribute in customer table. Let’s assume that customer names are unique (although in real situation it is not, let’s just assume it for ease of our design), and thus customer-name is a primary key in customer table and a foreign key in account table. Note that when drawing a schema diagram for a database, the following rules are maintained: head2right Each relation appears as a box, with the attributes listed inside it and the relation name above it. head2right If there are primary key attributes, a horizontal line crosses the box, with primary key attributes listed above the line. head2right It is customary to list the primary key attributes of a relation schema before the other attributes. head2right Foreign key dependencies appear as arrows from the foreign key attributes of the referencing relation (or table – both denotes the same thing) to the primary key of the referenced relation.
Image of page 9

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

View Full Document Right Arrow Icon
6 Okay, let’s get back to our business. If we analyze more carefully, we can confirm that a customer may have multiple accounts and a single account can be shared by multiple customers. So, the relationship with customer-name and account-number is many-to-many . So, according to what we learned previously, let’s split-up the account table and design a link table named – for example, depositor – like the following: branch account depositor customer branch-name account-number customer-name account-number customer-name branch-city assets branch-name balance customer-street customer-city Now remains the loan details . It’s much like the account details in relationship’s point of view. We need a foreign key branch-name and we know that the relationship between loan-number and customer-name is many-to-many (as a customer may take multiple loans and a single loan can be jointly taken by multiple customers). So, we can easily design a table named loan and a link table named – for example, borrower : branch account depositor customer branch-name account-number customer-name account-number customer-name branch-city assets branch-name balance customer-street customer-city loan borrower loan-number customer-name loan-number branch-name amount So that’s our final database schema diagram for the bank management system.
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the 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