3 Replies Latest reply on Aug 19, 2008 2:19 PM by Günter Schenk

    Database design help please..... insert into two tables...ect....

    mrcharis2003@yahoo.c Level 1
      Hi there

      I am trying to understand how databases work.
      I have been reading lots of stuff in the net and I starting to understand.... but there are some things I cannot find out.....
      So I decided to try here.... hope someone can help.

      I am trying to make a site which has a product database.... Which I can do already up and working fine.... but I now need to expand my database with many different tables to store all the different types of data I need.... primarily....user info, product info, manufacturer info,then more complex tables to enable me to intergrate a shopping cart..... eventually.

      SO
      One question..... maybe two.....

      Say I have a product table linked to the manufacturer table.

      from the pdt_man field in the product table linked to the primary id id_man in the manufacturer table

      I asume that the reason for having two tables is to not have to repeat the same info over and over again and be able to update easily etc....

      So.....
      How do I insert data in to two tables? ..... I know to use the insert into two tables wizard... but what if more than two tables? Do I use the many to many tool?

      And..... When I add a new product... from an insert record form... then I need to put the manufacturer how does my database know that the manufacturer I write is the same as one already in my database or a new one......

      Do I have to create a dropdown menu in my form to choose from manufacturers already in my database..... and another field to add a new manufacturer..?

      It is driving me crazy thinking about how these tables link together

      Any help would be greatly appreciated.....
      Any links, books, anything that would help me understand the database structure I need to set up a online store.... most importantly how the tables relat to each other....

      Thanks
      Have a nice day
        • 1. Re: Database design help please..... insert into two tables...ect....
          mohnkhan Level 1
          Hello,
          i had similar issues in my brain when i did my first database design.
          well that was long time back.
          I am no expert in this subject to give u suggestions.

          well I can be a fall back mode, if no suggestions got then u can safely use mine.:)

          Now Yes ADDT really wont directly help u in multiple linked tables..
          u need to sit and think a strategy of how users will interact with ur web interface.

          1.> yes anything that repeats we keep in separate table.
          2.> we link it with some unique key to its parent/master/ whatever....
          sometimes we do self links.

          now ur question about handling mutiple tables links..
          it gets not so easy with plain ADDT .
          it get time for u start using stored procedures and custom forms of ADDT.
          wherein u can call a function/ procedure stored in database which does all the house keeping into various tables.. for u in one go.

          there are many things which i cannot explain u in one post.

          i believe u should read a little more about best practices of database design

          hope this helps.

          mohnkhan
          • 2. Re: Database design help please..... insert into two tables...ect....
            Try checking out www.erdlibrary.com - they have loads of database designs including a couple for online shops. They also have related database designs for stock management, CMS systems, user systems etc..
            • 3. Re: Database design help please..... insert into two tables...ect....
              Günter Schenk Level 4
              limetree,

              -------
              Try checking out www.erdlibrary.com - they have...
              -------

              it shouldn´t read "they have" -- it should actually read "we have" or "I have", because a) it´s apparently your own company, as your forum account´s registered email address (contact@...) does relate to this company, and b) the erdilibrary website has a link to another website which contains the name "limetree-software".

              While your company´s *commercial* offerings may indeed be pretty helpful, your post in these forums is clearly to be regarded as spam respectively objectionable advertisement, what´s not permitted by Adobe´s "terms of use", which dictate that "you shall not...market any goods or services for any business purpose (including advertising and making offers to buy or sell goods or services), unless specifically allowed to do so by Adobe".

              I will not delete or edit your post, as it´s not completely out of context and possibly *might* help some users, but you may rest assured that further attempts to advertise your company´s offerings in these forums will not be tolerated.

              Günter Schenk
              Adobe Community Expert, Dreamweaver