SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    teesside
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    data model problem

    Im a newbie this is my first data model.

    I am looking for advice regarding tidying this model up so I can move onto the next stage.

    Any comments please give them to me. Greatley Appreciated

    Cheers

    Richard


  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    My only question is can a product be related to multiple product types? According to your model they can't be but is that a possibility? I would build it in just in case.

    Also, I would not make the login_name the primary key. Instead, give every user an id. You can keep the login name but use the id as a reference in other tables.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    teesside
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    many thanks for that, ive attatched the up dated version.

    question:
    My only question is can a product be related to multiple product types? According to your model they can't be but is that a possibility? I would build it in just in case.
    Would this create a many to many relationship, if so is not bad practice?

    Dose it not mean there should be another table is needed?



    Cheers
    Richard

  4. #4
    SitePoint Guru asterix's Avatar
    Join Date
    Jun 2003
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hartmann
    Also, I would not make the login_name the primary key. Instead, give every user an id. You can keep the login name but use the id as a reference in other tables.
    Why? Where is the value in having multiple users having the same login_name?
    You could give login_name a unique constraint and then add an auto_increment, but again why?

    It is always best not to introduce new attributes, but to see which of the candidate key has uniqueness and minimality. ergo login_name.

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    asterix, bravo

    you saw this other thread, then?

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Guru asterix's Avatar
    Join Date
    Jun 2003
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep. I love a good multi-post

  7. #7
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face data model cases

    Hello!
    I am new here! I just trying to learn to build data models. Please, share your free resourses with study cases or examples on which I can build my models !
    Sincerely yours, Madinak.


Bookmarks

Posting Permissions

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