Urgent Normalisation help!!!

  • To what tables?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • foreign keys to order and supplier and stock

  • Order has foreign keys to what tables?

    Supplier has foreign keys to what tables?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • customer has many orders

    so customer is foreign key in orders table

    a supplier suplies many stock

    so supplier is a foreign key in stock table

    right?

  • You're the one doing the design, I'm just guiding.

    So, we have so far this:

    Customer

    Customer Forename

    Customer Surname

    Street

    Town

    Postcode

    Email

    Category

    -------------------------

    Order

    Order Date

    description

    price

    qty ordered

    Reference to Customer Table

    ----------------------

    Stock

    Stock Description

    Price

    Qty in Stock

    Reference to Supplier table

    ----------------------

    Supplier

    Supplier Name

    Supplier Address

    Supplier Town

    Supplier Postcode

    Supplier Tel No

    Anything look missing there?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • there is no link to order table

  • What needs a link to the order table?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • am sure its the customer table that links to the order table

    but maybe we can create another table

  • Really? Customers has a foreign key to orders? Think about it, do customers belong to an order or do orders belong to a customer?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • orders belong to a customer

  • Aty01 (3/27/2012)


    there is no link to order table

    Stepping in a minute. Look at your Order table and think of an order you may have placed with a company. How many items can one customer order at one time? How many times do you see the customer information on that order?

  • i had this before is this right

  • Lynn Pettis (3/27/2012)


    Aty01 (3/27/2012)


    there is no link to order table

    Stepping in a minute. Look at your Order table and think of an order you may have placed with a company. How many items can one customer order at one time? How many times do you see the customer information on that order?

    Getting there....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • one customer can have many orders

  • GilaMonster (3/27/2012)


    Lynn Pettis (3/27/2012)


    Aty01 (3/27/2012)


    there is no link to order table

    Stepping in a minute. Look at your Order table and think of an order you may have placed with a company. How many items can one customer order at one time? How many times do you see the customer information on that order?

    Getting there....

    I know, but you started looking at Orders, so thought it was a good time to expand thoughts around that one item.

Viewing 15 posts - 16 through 30 (of 59 total)

You must be logged in to reply to this topic. Login to reply