Why dont you try those for yourself right now umm you

Info icon This preview shows pages 8–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Why don’t you try those for yourself right now? [Umm… you might think that the account table seems to be lonely. However, when you’ll be designing a database in a real situation, you’ll definitely find that the account table does not consist of only one attribute. It will contain more than one fields, for example, balance – the amount of money currently available under that account number.] What we’ve learnt from this section is that when a many-to-many relationship exists – suppose – from field A to field B , we’ll create three tables: in the first one, we’ll keep the field A and the fields related to it; in the second one, we’ll place the field B and the fields related to it; and finally, in the last table, we’ll put two fields from the previous two tables which are primary keys of those tables. The last table is just a linking table. To sum-up, we have to follow the following steps when designing a database: 1. Identify which attributes we need and place them into relevant tables. 2. Identify the primary keys of the tables. 3. Identify the relations among the attributes and modify table design accordingly. Note that these steps are the primary steps for designing a database. There are other issues to consider when designing a database efficiently. We’ll discuss those later. customer-name customer-street customer-city account-number Figure 2: Relationships among the attributes of customer table. Legend One-to-one Many-to-many Primary Key Foreign Key Primary Key Foreign Key
Image of page 8

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

View Full Document Right Arrow Icon
5 Example Database Design Let’s design a database for bank management. First, we have to determine which information we need to manage the bank. Suppose we need the following information: 1. Branch details – which might include branch name, branch city and total assets of that branch. 2. Customer details – customer name, his street address and the city he lives in. 3. Account details – the account numbers, which branches the accounts are from, their owners and their balances. 4. Loan details – the loan numbers, which branches the loans are from, their borrowers and their amounts. Next, let’s try to figure out the relationships among these attributes so that we can determine which tables we should need and which attributes should go to which table. First, we’ve to figure out which attributes are not related to each-other. The bank details are not in any way related to customer details. So, we can safely create two tables named – for example – branch and customer . We can fill those tables with necessary attributes – branch-name , branch-city and assets in branch table; and customer-name , customer-street and customer-city in customer table. Our database schema up to this point should look like the following: branch customer branch-name branch-city assets customer-name customer-street customer-city Now, the account details seems to contain attributes which relate to attributes in both branch details and customer details. So, we can create a table named accounts and put the necessary attributes (
Image of page 9
Image of page 10
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