CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: normalization

  1. #1
    Join Date
    Sep 2004
    Posts
    13

    Arrow normalization

    hii
    i have these unnormalized data..i wanna normalized these up to 3NF.
    I tried 1st NF..but im not sure whether its correct ..if anyone can pls help me.

    HIREINFO (Machine_ID, Hire_customer_name, Hire_customer_address, Date_of_hire, Days_hire, Price_of_hire_per_day, Hire_customer_category, Category_description, Hire_category_discount_percentage)

    1st NF-

    Customer_Details ([Customer_ID, Machine_ID]pk, Hire_customer_name, Hire_customer_address, Hire_customer_category, Category_description, Hire_category_discount_percentage)

    Hire_Details (Machine_ID[pk], Date_of_hire, Days_hire, Price_of_hire_per_day,)

  2. #2
    Join Date
    Jul 2007
    Location
    Sweden
    Posts
    331

    Re: normalization

    You've got machine, customer, category and hire occasion. The machine information isn't actually included (it is only referenced), so I haven't listed it as a table below:

    Code:
    Customers
     Customer_ID [PK]
     Name
     Address
    
    Hire_occasions
     Hire_occasion_ID [PK]
     Category_ID [FK]
     Customer_ID [FK]
     Machine_ID [FK]
     Date_of_hire
     Days_hire
     Price_of_hire_per_day
    
    Categories
     Category_ID [PK]
     Name
     Description
     Discount_percentage
    The "Hire_customer_category" confuses me a bit - I assumed it's a category for the hire, but it almost sounds as if it's a category for the customer. If that's the case, move Category_ID in Hire_occasions to Customers.

    If the Price_of_hire_per_day is determined by the category, you could copy the field to Categories. I wouldn't keep it only in Categories however, as you wouldn't want to risk it changing for a category and tainting your historical data (the price would suddenly change for hires that have already occurred.)

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured