Close

Results 1 to 8 of 8

Thread: ER Modelling?

  1. #1
    DF VIP Member Roo's Avatar
    Join Date
    Aug 2002
    Location
    UK - Coventry
    Posts
    529
    Thanks
    0
    Thanked:        0
    Karma Level
    290

    Default ER Modelling?

    Hey guys, dunno if any of you are any good with basic Entity Relationship modelling but Im a little stuck on something.

    I need to model this example basically,

    An employee can work on many projects but only one project per city. An employee can have many skills but can only use a given set of skills on a single project.
    So I was thinking of using an 'assigned', and doing somet like this,

    employee
    |
    |
    skill ----------- assigned ---------- project
    |
    |
    city

    So it would read, that an employee is assigned to a project within a city and uses a set of skills within that city? But I dont think thats right lol, plus how do I show that an employee can only work on 1 project per city and use only a given set of skills within 1 project?

    Please help, asap would be good lol.
    CONTACT

    My liver is evil and must be punished!



  2. #2
    DF VIP Member blacksheep's Avatar
    Join Date
    Jun 2006
    Location
    Manchester
    Posts
    3,877
    Thanks
    87
    Thanked:        265
    Karma Level
    546

    Default Re: ER Modelling?

    its just cardinality - you mark the bounds on the diagram ie 1..* would be one to many or 1 would mean 1 and only one

  3. #3
    DF VIP Member tam9's Avatar
    Join Date
    Apr 2002
    Location
    The city of R
    Posts
    3,855
    Thanks
    2
    Thanked:        1
    Karma Level
    637

    Default Re: ER Modelling?

    There's 3 kinds, 1 to 1, 1 to many and many to many. It's a hard subject to grasp but once grasped you have just entered a new realm of power. Relational Databases are great and with the likes of MySQL they are getting better and better..but lets hope not too good or we'll start to be out of jobs soon enough

  4. #4
    DF VIP Member Roo's Avatar
    Join Date
    Aug 2002
    Location
    UK - Coventry
    Posts
    529
    Thanks
    0
    Thanked:        0
    Karma Level
    290

    Default Re: ER Modelling?

    Cheers for the replies guys, I know what you mean, but its much more difficult then that. This is known as a 'complex relationship'.

    Its not as simple as 1 to many, etc as there can be 1 employee to many projects but only one employee to a city. But there can also be many projects to a city, if you see what I mean?

    Any other ideas?
    CONTACT

    My liver is evil and must be punished!



  5. #5
    DF VIP Member tam9's Avatar
    Join Date
    Apr 2002
    Location
    The city of R
    Posts
    3,855
    Thanks
    2
    Thanked:        1
    Karma Level
    637

    Default Re: ER Modelling?

    Yes, thats many to many relation ships mate...right this guy joe who stays in manchester has the projects of sales, advertising and publishing

    and now we have that prick pete who joe hates also heading up a few projects in manchester but pete is fortunate enough to stay in preston and manage the projects from there. So in effect we have pete and joe from different parts of the country managing effectively the same projects or diffetrent projects in the 1 city.

    My method for creating simple db's is to do diagrams...and with larger scale db's.

    Does that make sense?

  6. #6
    DF VIP Member
    RhinoBanga's Avatar
    Join Date
    Nov 2000
    Location
    127.0.0.1
    Posts
    1,780
    Thanks
    20
    Thanked:        13
    Karma Level
    389

    Default Re: ER Modelling?

    In these circumstances I use cross-reference tables to determine the relationship, e.g.:

    employee (parent)
    emp_no


    project (parent)
    project_no


    skill (parent)
    skill_no


    city (parent)
    city_no


    project_employee_xref (child)
    project_no
    emp_no


    skill_employee_xref (child)
    skill_no
    emp_no


    city_project_xref (child)
    city_no
    project_no


    etc
    etc



    The actual limitions/business rules, e.g. 1:1 or 1:*, is handled by triggers.

  7. #7
    DF VIP Member Roo's Avatar
    Join Date
    Aug 2002
    Location
    UK - Coventry
    Posts
    529
    Thanks
    0
    Thanked:        0
    Karma Level
    290

    Default Re: ER Modelling?

    Quote Originally Posted by RhinoBanga View Post
    In these circumstances I use cross-reference tables to determine the relationship, e.g.:

    employee (parent)
    emp_no


    project (parent)
    project_no


    skill (parent)
    skill_no


    city (parent)
    city_no


    project_employee_xref (child)
    project_no
    emp_no


    skill_employee_xref (child)
    skill_no
    emp_no


    city_project_xref (child)
    city_no
    project_no


    etc
    etc



    The actual limitions/business rules, e.g. 1:1 or 1:*, is handled by triggers.
    So how would I model that then?

    Tam9, yes I understand. Didnt mean to sound patronizing or anything mate.
    CONTACT

    My liver is evil and must be punished!



  8. #8
    Argyll's Apprentice TwoPlAnKs's Avatar
    Join Date
    May 2003
    Location
    Aberdeenshire
    Posts
    5,191
    Thanks
    0
    Thanked:        0
    Karma Level
    620

    Default Re: ER Modelling?

    figure out what you want the database to be in your head, it'll take about 30 seconds, make sure it works and then you can draw the diagram from that
    "The Net interprets censorship as damage and routes around it." - John Gilmore

Similar Threads

  1. [NSFW] Modelling Session #2 (Natalie)
    By _Belial in forum Your Photos & Artwork
    Replies: 23
    Last Post: 7th June 2008, 03:21 AM
  2. I return from my 1st modelling photoshoot
    By _Belial in forum Talk About Photography
    Replies: 32
    Last Post: 12th May 2008, 08:12 PM
  3. First Modelling shoot this weekend - tips/advice?
    By _Belial in forum Talk About Photography
    Replies: 34
    Last Post: 11th May 2008, 01:20 PM
  4. Baby Modelling Companies - Legit Ones
    By TIN CAN in forum The Dog and Duck
    Replies: 4
    Last Post: 16th November 2007, 08:08 AM
  5. NSFW: How NOT to audtion for a modelling job!
    By Pegasus in forum Funny/Strange Video Clips
    Replies: 32
    Last Post: 1st March 2006, 10:25 PM

Social Networking 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
  •