SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: database design

  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    database design

    hi,
    can any tell me if my basic db layout is ok like this?

    Each project has multiple phases.
    Each phase has multiple resources

    -There can be more of the same phase in one project
    -There can be more of the same resource in one phase

    thanks

    pete

    _projects
    id
    start_date
    end_date
    client_id

    _phases
    id
    description

    _phases2projects
    id
    project_id
    phase_id

    _resources
    id
    description

    _resources2phases
    phases2projects_id
    resource_id
    utilization

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    619
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks good, just make sure you make all those ID fields indexes. Of course the parent ones should be primary keys.

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    remove the phases2projects.id column, and make (project_id, phase_id) your primary key.

    also remove the resources2phases.phases2projects_id column, add project_id, phase_id to that table, and make (project_id, phase_id, resource_id) the primary key.


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
  •