accxp_ch10 - Chapter 10 Creating a Business Invoice System...

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

View Full Document Right Arrow Icon
© Guided Computer Tutorials 2004 10-1 Chapter 10 Creating a Business Invoice System To fully understand the value of relational databases you need to create a detailed system. In this chapter you will create an invoicing system for a computer mail order company, PC Direct, which sells computer peripherals through the mail. There are three main sections to the system, customers, products and the sales invoice. In the creation of any database system you should do some careful planning. In general there are four steps that you should undertake. 1 Decide how many tables you think you might need. 2 Decide how the tables will be related to one another. 3 List the fields in each table trying to avoid having the same field in more than one table. Decide which fields will be the PRIMARY KEY and FOREIGN KEY fields to link the tables. 4 Decide what forms and/or reports (or printouts) are required. In the case of PC Direct an initial TABLE RELATIONSHIP diagram might be: The CUSTOMERS to INVOICE section of this structure forms a ONE TO MANY relationship. The one customer can have MANY invoices sent to them over time, but there will always be ONE customer on each invoice. So the customer table is the ONE side of the relationship and the INVOICE is the MANY side. We can set a relationship to link these two tables. There is a problem with the connection between the INVOICE and the PRODUCTS tables. The one invoice can contain many products and the one product can be included in many invoices. A relational database cannot cater for a MANY TO MANY relationship as you cannot set multiple PRIMARY or FOREIGN KEY fields in the one relationship. A further problem exists, one invoice might contain a sale of 5 of a particular item, the next invoice might contain a sale of 2 of the same item. The company needs a way of adding these sales so that it knows how many items it has sold. So this initial TABLE RELATIONSHIP will need modification. The easiest solution to these problems is to add a table between INVOICE and PRODUCTS. This table can store every item sold by the company as a single record allowing the company to keep track of every item sold. The new table can also provide data to the INVOICE table.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
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