dcsimg
Results 1 to 2 of 2

Thread: Database Normalization

  1. #1
    Join Date
    Apr 2019
    Posts
    1

    Database Normalization

    I have a invoice that I am trying to normalize to 3NF. I got it to 2NF but am stuck on 3NF because I am not sure what to do with the Order Number attribute.

    UNF:
    Invoice Number
    Invoice Date
    Order Number
    Quantity
    Products
    Item Number
    Unit Price
    Tax
    Total
    Customer Name
    Billing Address
    Shipping Address

    1NF:
    Invoice Number(PK)
    Invoice Date
    Order Number
    Quantity
    Products
    Item Number(PK)
    Unit Price
    Tax
    Total
    Customer Name
    Customer ID
    Billing Address
    Shipping Address

    2NF:
    Invoice Number(PK)
    Invoice Date
    Customer Name
    Customer ID
    Billing Address
    Shipping Address

    Item Number(PK)
    Quantity
    Products
    Unit Price
    Tax
    Order Number
    Total

    3NF:
    Invoice
    Invoice Number(PK)
    Invoice Date
    Customer ID(FK)

    Customers
    Customer ID(PK)
    Customer Name
    Billing Address
    Shipping Address

    Items
    Item Number(PK)
    Products
    Unit Price
    Tax

    Order Line
    Item Number(PK,FK)
    Customer ID(PK,FK)
    Order Number(PK)
    Quantity
    Total

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,910
    You need to have Order table where you will have order number, customer id. FK to Orderline on order number.

    Tax should not be on Items table as it may vary by state, it should be in Order table.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •