Is there anything wrong with my DB design ?

  • Hi expert,
    I am abit unsure about my DB design if it's correct or not. 
    Basically, they are some parts which I emulate from another project code.
    cos there are many-to-many relationship between requestOrder and retrievalDetail and I wonder if it is good to have it like that.
    And I think there should be a line that linked Department and RequestOrder right ?
    Hope to have some comments on it.

    Tks.

  • Build out a piece of it, add some dummy data and write some queries. Lather, rinse repeat.  That's the way most of us learned. If you make a mistake, your query won't work.

  • The relationships between RequestOrder, RefNo and RetrievalDetail are very unclear.

    As to whether or not there's a link between RequestOrder and Department... I don't know. You tell me. What is the business need?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • You have some columns that seem to be repeated in different tables such as DeptCode or MaterialName.
    There aren't many to many relationships between two tables, you need to create an intermediate table for that.
    Some columns seem to belong to the detail tables and you also have them in the header table (Request Order).

    Without more details is hard to tell if things are right or not. As Grant said, it's all about the business needs.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Just some questions:
    Is there any reference between RequestOrder.DeptCode and RequestOrder.DeptId_FK to your Department table?
    Why would you include a PhoneExt in a RequestOrder table, I would imagine this would rather belong with the Requester/issues/human/department entity?

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • Luis Cazares - Wednesday, February 22, 2017 7:02 AM

    You have some columns that seem to be repeated in different tables such as DeptCode or MaterialName.
    There aren't many to many relationships between two tables, you need to create an intermediate table for that.
    Some columns seem to belong to the detail tables and you also have them in the header table (Request Order).

    Without more details is hard to tell if things are right or not. As Grant said, it's all about the business needs.

    Hi, please see attached use case diagram and let me know. Tks.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply