Results 1 to 9 of 9

Thread: 1ST NORMAL fORM

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144

    1ST NORMAL fORM

    Can any one normalise this to 1st normal form?

    Registration No.
    Date purchased
    Cost
    Number of seats
    garage ID
    garage name
    garage address
    service date
    service cost

    The garage information represents each service the car has had

    thanks

  2. #2
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494
    Just quickly cos my tea is ready....

    Three tables

    tblCar
    Registration No.
    Date purchased
    Cost
    Number of seats

    tblGarage
    garage ID
    garage name
    garage address

    tblService
    garage ID
    Registration No.
    service date
    service cost

    Don't forget to lose the spaces in the field names
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144
    to me that looks like 2nd and i think 2nd is the furthest it will normalise as 3rd will be done in 2nd nomal form

    i think 1st NF is somthing like this

    tblCar:

    Registration No.
    Date purchased
    Cost
    Number of seats

    tblGarage:

    garage ID
    garage name
    garage address
    service date
    service cost
    Registration No.

    i think the rule is remove the repeating groups

    and 2nd NF would be

    tblCar:

    Registration No.
    Date purchased
    Cost
    Number of seats

    tblGarage:

    garage ID
    garage name
    garage address
    Registration No.

    tblService:

    service date
    service cost
    garage ID

    please correct me if im wrong
    Last edited by JamesBowtell; Nov 10th, 2004 at 03:39 PM.

  4. #4
    Hyperactive Member Lil Ms Squirrel's Avatar
    Join Date
    Nov 2004
    Location
    planet squirrel
    Posts
    494
    Any reason why you only want it normalised to 1NF anyway?
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.
    Dr. Seuss

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144
    Because i'm learning the steps to change data from un-normalised data to 1ST 2ND and 3RD Normal Form. Therefore, was the post i corrected any good?

    thanks

  6. #6
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: 1ST NORMAL fORM

    Originally posted by JamesBowtell
    Can any one normalise this to 1st normal form?

    Registration No.
    Date purchased
    Cost
    Number of seats
    garage ID
    garage name
    garage address
    service date
    service cost

    The garage information represents each service the car has had

    thanks
    This is already in First Normal Form.

    First normal form requires that you dont have repeating data horizontally e.g have two of same fields (Garage Name twice).

    Read this article, it might help you to undrstand more http://dev.mysql.com/tech-resources/...alization.html
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144
    So your saying this is 2nd NF?

    tblCar:

    Registration No.
    Date purchased
    Cost
    Number of seats

    tblGarage:

    garage ID
    garage name
    garage address
    service date
    service cost
    Registration No

  8. #8
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by JamesBowtell
    So your saying this is 2nd NF?

    tblCar:

    Registration No.
    Date purchased
    Cost
    Number of seats

    tblGarage:

    garage ID
    garage name
    garage address
    service date
    service cost
    Registration No
    I dont think it is yet if your relation between Car and Garage is Many to Many. You will have data duplication e.g same garage name twice.

    Now if in your scenario many to many is not needed and it is a one two many between Garage -> Car (1 Grage services many car, 1 care is Serviced at 1 Garage) then post the GarageID in Car table instead of RegNo in Garage Table

    If your scenario is many 2 many relationship(1 car is serviced at many Garage, 1 Garage services many Cars) then you would need to decompose the table and have what they called Bridge Table.

    e.g
    Car:
    Registration No (Primary Key)
    Date purchased
    Cost
    Number of seats

    Garage:
    garage ID (Primary Key)
    garage name
    garage address
    service date
    service cost

    Car_Garage:
    Registration No
    GarageID
    (Primary key : Registration No and GarageID)
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Posts
    144
    So by doing that it would be in 2nf? this is confusing...lol

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