Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database design question

Database design question

Scheduled Pinned Locked Moved Database
questiondatabasedesign
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Quake2Player
    wrote on last edited by
    #1

    Hi, I have a table of product movements between places, Table Movements {fromId, toId, date, productId, status, firmware, etc} And a table of all the products Table Products {productId, name, status, firmware, etc} My question is if its OK this design, in particular the bolded things. In each movement some properties of the product will change (status and firmware), but the one that is really active and prevailing is the one in the Products table.. So if I want to know the prevailing status I'll ask the Products table.. and if i want to know the status that some product had last tuesday I'll ask the Movements table. Another solution could be to have a table Table ProductProperties {productPropertiesId, status, firmware} and the other two would be like: Table Movements {fromId, toId, date, productId, productPropertiesId} Table Products {productId, name, currentPropertiesId} Any comments?

    _ J P 3 Replies Last reply
    0
    • Q Quake2Player

      Hi, I have a table of product movements between places, Table Movements {fromId, toId, date, productId, status, firmware, etc} And a table of all the products Table Products {productId, name, status, firmware, etc} My question is if its OK this design, in particular the bolded things. In each movement some properties of the product will change (status and firmware), but the one that is really active and prevailing is the one in the Products table.. So if I want to know the prevailing status I'll ask the Products table.. and if i want to know the status that some product had last tuesday I'll ask the Movements table. Another solution could be to have a table Table ProductProperties {productPropertiesId, status, firmware} and the other two would be like: Table Movements {fromId, toId, date, productId, productPropertiesId} Table Products {productId, name, currentPropertiesId} Any comments?

      _ Offline
      _ Offline
      _Damian S_
      wrote on last edited by
      #2

      It's a little confusing... At what point does the Product table get updated to reflect its new status/firmware etc? Why does moving something from one place to another change these? Can a product exist that never moves?

      I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

      Q 1 Reply Last reply
      0
      • Q Quake2Player

        Hi, I have a table of product movements between places, Table Movements {fromId, toId, date, productId, status, firmware, etc} And a table of all the products Table Products {productId, name, status, firmware, etc} My question is if its OK this design, in particular the bolded things. In each movement some properties of the product will change (status and firmware), but the one that is really active and prevailing is the one in the Products table.. So if I want to know the prevailing status I'll ask the Products table.. and if i want to know the status that some product had last tuesday I'll ask the Movements table. Another solution could be to have a table Table ProductProperties {productPropertiesId, status, firmware} and the other two would be like: Table Movements {fromId, toId, date, productId, productPropertiesId} Table Products {productId, name, currentPropertiesId} Any comments?

        J Offline
        J Offline
        Johan Hakkesteegt
        wrote on last edited by
        #3

        Quake2Player wrote:

        In each movement some properties of the product will change (status and firmware), but the one that is really active and prevailing is the one in the Products table.. So if I want to know the prevailing status I'll ask the Products table.. and if i want to know the status that some product had last tuesday I'll ask the Movements table.

        This is definitely the best solution. The other solution would only create one extra table you would need to query, making your queries needlessly complicated.

        My advice is free, and you may get what you paid for.

        1 Reply Last reply
        0
        • _ _Damian S_

          It's a little confusing... At what point does the Product table get updated to reflect its new status/firmware etc? Why does moving something from one place to another change these? Can a product exist that never moves?

          I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

          Q Offline
          Q Offline
          Quake2Player
          wrote on last edited by
          #4

          The last movement associated to some product determines its status/firmware. But yes, there might be products that havent been moved ever yet.

          1 Reply Last reply
          0
          • Q Quake2Player

            Hi, I have a table of product movements between places, Table Movements {fromId, toId, date, productId, status, firmware, etc} And a table of all the products Table Products {productId, name, status, firmware, etc} My question is if its OK this design, in particular the bolded things. In each movement some properties of the product will change (status and firmware), but the one that is really active and prevailing is the one in the Products table.. So if I want to know the prevailing status I'll ask the Products table.. and if i want to know the status that some product had last tuesday I'll ask the Movements table. Another solution could be to have a table Table ProductProperties {productPropertiesId, status, firmware} and the other two would be like: Table Movements {fromId, toId, date, productId, productPropertiesId} Table Products {productId, name, currentPropertiesId} Any comments?

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            I probably wouldn't have status and firmware in the Product table. When a new Product created I'd create the first Movement (created, bought, whatever) record for that Product.

            Q 1 Reply Last reply
            0
            • P PIEBALDconsult

              I probably wouldn't have status and firmware in the Product table. When a new Product created I'd create the first Movement (created, bought, whatever) record for that Product.

              Q Offline
              Q Offline
              Quake2Player
              wrote on last edited by
              #6

              Oh thats a nice solution.. Though the movements are used in other parts of the software.. so this "dummy" movements would have to have different properties.. like "from = to"

              P 1 Reply Last reply
              0
              • Q Quake2Player

                Oh thats a nice solution.. Though the movements are used in other parts of the software.. so this "dummy" movements would have to have different properties.. like "from = to"

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                You might instead have a dummy location for the from value, e.g. "thin air".

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups