Results 1 to 13 of 13

Thread: Normalization

  1. #1
    Join Date
    Jun 2007
    Posts
    33

    Question Unanswered: Normalization

    Hi all,
    i have a problem understanding the 3NF in my case...
    i have 2 types of information that i what in db, Persons and Call's(1 person => 1 call):

    now my problem...
    T1=(PersonID,Name)

    should i create 1 more table sinse the relation is 1 to 1
    T2=(CallId,PersonId,Description,Date,A,B,C,D,E)

    or more 2 tables...
    T2=(CallId,Description,Date,A,B,C,D,E)
    T3=(CallId,PersonId)

    Wich way is bether and faster?
    To me only creating 2 tables (space) but for 3FN, for what I understand, 3 tables (Faster data access?)

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if the relation is 1 to 1 you can combine them into one table
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2007
    Posts
    33
    Hi, ty by the reply.
    yes, it's 1 to 1, but wich is faster to access to data since there will be lots of records?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    accessing one table will always be faster than accessing two tables in a join
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2007
    Posts
    33
    Much ty

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    One person can only make one call?
    That doesn't sound right to me!

    Just to clarify; the A,B,C,D,E,F...) are what exactly?
    George
    Home | Blog

  7. #7
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    It sounds to me like you have at least a 1 to many relationship. One person can make many calls. If you have the ability to store conference calls then you have a many to many relationship. One call can include many people.

  8. #8
    Join Date
    Jun 2007
    Posts
    33
    sorry

    this is like a call's record.
    Person (N5) made a call (N: 1)
    Person (N5) made a call (N: 2)
    Person (N7) made a call (N: 3)
    One person can make lots of call's but 1 call can only be made form 1 person.
    (Just edited) Yep... its 1 to N (my mistake) so is bether go for creating 3 tables??....


    A,B,C,D,E,F... it's more field's... like A=Resolved, B=Private....
    What i mean with this is if a query to a table with lots of field's is faster then a query to a table with 2 field's but have to open another table (3NF).

    Dono if i made my myself clear...
    Last edited by PedroF; 07-18-07 at 19:07.

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Callers(CallerID, FirstName, LastName, etc)
    Calls(CallID, CallerID, IsResolved, IsPrivate, etc)
    Code:
    --Select all calls by one user
    SELECT CallID, IsResolved, IsPrivate, etc
    FROM Calls
    LEFT JOIN Callers
    ON Calls.CallerID = Callers.CallerID
    Normalization is the key!

    And in terms of speed;
    A properly normalized database will always be better than a poorly designed hunk of data!
    George
    Home | Blog

  10. #10
    Join Date
    Jun 2007
    Posts
    33
    Ty again.
    That was a good lesson.

  11. #11
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if its lessons you are after... Paul Litwin has something on relational theory here; well worth looking at in my view
    I'd rather be riding on the Tiger 800 or the Norton

  12. #12
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Couldn't agree more. Add that link to your favourites and give it a good 2 or 3 reads (I'm deadly serious!)
    George
    Home | Blog

  13. #13
    Join Date
    Jun 2007
    Posts
    33
    ty again

Posting Permissions

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